You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ro...@hyperreal.org on 1999/08/15 23:55:11 UTC
cvs commit: apache-1.3/src/ap ap_md5c.c ap_sha1.c
ronald 99/08/15 14:55:10
Modified: src/ap ap_md5c.c ap_sha1.c
Log:
fix password hash generation (ap_cpystrn needs to be told to copy n+1 chars)
Revision Changes Path
1.31 +2 -2 apache-1.3/src/ap/ap_md5c.c
Index: ap_md5c.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/ap/ap_md5c.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ap_md5c.c 1999/08/14 09:31:04 1.30
+++ ap_md5c.c 1999/08/15 21:55:09 1.31
@@ -527,8 +527,8 @@
* Now make the output string. We know our limitations, so we
* can use the string routines without bounds checking.
*/
- ap_cpystrn(passwd, AP_MD5PW_ID, AP_MD5PW_IDLEN);
- ap_cpystrn(passwd + AP_MD5PW_IDLEN, (char *)sp, sl);
+ ap_cpystrn(passwd, AP_MD5PW_ID, AP_MD5PW_ID + 1);
+ ap_cpystrn(passwd + AP_MD5PW_IDLEN, (char *)sp, sl + 1);
passwd[AP_MD5PW_IDLEN + sl] = '$';
passwd[AP_MD5PW_IDLEN + sl + 1] = '\0';
1.10 +1 -1 apache-1.3/src/ap/ap_sha1.c
Index: ap_sha1.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/ap/ap_sha1.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ap_sha1.c 1999/08/14 08:35:46 1.9
+++ ap_sha1.c 1999/08/15 21:55:09 1.10
@@ -371,7 +371,7 @@
ap_SHA1Final(digest, &context);
/* private marker. */
- ap_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN);
+ ap_cpystrn(out, AP_SHA1PW_ID, AP_SHA1PW_IDLEN + 1);
/* SHA1 hash is always 20 chars */
l = ap_base64encode_binary(out + AP_SHA1PW_IDLEN, digest, sizeof(digest));