Merge pull request #446 from lishiao144/master
Fix CHAP response buffer zero-init and increase MAX_CHAP_R_SIZE to support SHA-256
This commit is contained in:
@@ -98,7 +98,7 @@ struct iscsi_in_pdu {
|
|||||||
void iscsi_free_iscsi_in_pdu(struct iscsi_context *iscsi, struct iscsi_in_pdu *in);
|
void iscsi_free_iscsi_in_pdu(struct iscsi_context *iscsi, struct iscsi_in_pdu *in);
|
||||||
|
|
||||||
/* size of chap response field */
|
/* size of chap response field */
|
||||||
#define MAX_CHAP_R_SIZE 20 /* md5:16 sha1:20 */
|
#define MAX_CHAP_R_SIZE 32 /* md5:16 sha1:20 */
|
||||||
|
|
||||||
/* max length of chap challange */
|
/* max length of chap challange */
|
||||||
#define MAX_CHAP_C_LENGTH 2048
|
#define MAX_CHAP_C_LENGTH 2048
|
||||||
|
|||||||
@@ -936,7 +936,7 @@ iscsi_login_add_chap_response(struct iscsi_context *iscsi, struct iscsi_pdu *pdu
|
|||||||
|
|
||||||
/* bidirectional chap */
|
/* bidirectional chap */
|
||||||
if (iscsi->target_user[0]) {
|
if (iscsi->target_user[0]) {
|
||||||
char target_chap_c[MAX_CHAP_R_SIZE * 2];
|
char target_chap_c[MAX_CHAP_R_SIZE * 2] = {0};
|
||||||
|
|
||||||
iscsi->target_chap_i++;
|
iscsi->target_chap_i++;
|
||||||
snprintf(str, MAX_STRING_SIZE, "CHAP_I=%d",
|
snprintf(str, MAX_STRING_SIZE, "CHAP_I=%d",
|
||||||
|
|||||||
Reference in New Issue
Block a user