From: Kurt Zeilenga Date: Wed, 2 Jun 2004 20:29:21 +0000 (+0000) Subject: Apply same fix (as last commit) to SMD5 as well X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~301 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c15a31b673fbb9541cf9b520191a6e0bdb6330a9;p=openldap Apply same fix (as last commit) to SMD5 as well --- diff --git a/libraries/liblutil/passwd.c b/libraries/liblutil/passwd.c index 3ce1ae9757..f16b49a2bc 100644 --- a/libraries/liblutil/passwd.c +++ b/libraries/liblutil/passwd.c @@ -547,8 +547,7 @@ static int chk_smd5( unsigned char *orig_pass = NULL; /* safety check */ - if (LUTIL_BASE64_DECODE_LEN(passwd->bv_len) < - sizeof(MD5digest)+SALT_SIZE) { + if (LUTIL_BASE64_DECODE_LEN(passwd->bv_len) <= sizeof(MD5digest)) { return LUTIL_PASSWD_ERR; } @@ -560,7 +559,7 @@ static int chk_smd5( rc = lutil_b64_pton(passwd->bv_val, orig_pass, passwd->bv_len); - if (rc < (int)(sizeof(MD5digest)+SALT_SIZE)) { + if (rc <= (int)(sizeof(MD5digest))) { ber_memfree(orig_pass); return LUTIL_PASSWD_ERR; }