httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Life is hard, and then you die." <ron...@innovation.ch>
Subject Re: [Bug] htpasswd SHA doean't work (was: real 1.3.9 status)
Date Sun, 15 Aug 1999 19:42:03 GMT

> Out of curiosity, I tried the new password hashing schemes.
> And, no: the htpasswd does NOT work for me (mips-siemens-svr4).
> 
> When encoding using...
>     % htpasswd -b -s .htpasswd basicsha password
> the file .htpasswd contains:
>     basicsha:{SHA
> and that's it - the rest of the line is empty.

Hmm, this bug got introduced a couple days ago. The fix is:

Index: ap_sha1.c
===================================================================
RCS file: /home/cvs/apache-1.3/src/ap/ap_sha1.c,v
retrieving revision 1.9
diff -u -r1.9 ap_sha1.c
--- ap_sha1.c   1999/08/14 08:35:46     1.9
+++ ap_sha1.c   1999/08/15 19:34:39
@@ -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));

(the original strcpy() was replaced by ap_cpystrn which needs to be told
to copy strlen()+1 bytes).

What's the state: should this be commited?


  Cheers,

  Ronald


Mime
View raw message