]> git.ozlabs.org Git - ppp.git/commitdiff
change MD5Final to explicitly return hash
authorPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:55:14 +0000 (05:55 +0000)
committerPaul Mackerras <paulus@samba.org>
Wed, 30 Apr 1997 05:55:14 +0000 (05:55 +0000)
pppd/md5.c

index 480c860c0aa9b0d9aa2be2001804ca56e4b09f54..db48023c5b5c294d943fadad41c360770cef9cd2 100644 (file)
@@ -156,7 +156,8 @@ unsigned int inLen;
 /* The routine MD5Final terminates the message-digest computation and
    ends with the desired message digest in mdContext->digest[0...15].
  */
-void MD5Final (mdContext)
+void MD5Final (hash, mdContext)
+unsigned char hash[];
 MD5_CTX *mdContext;
 {
   UINT4 in[16];
@@ -193,6 +194,7 @@ MD5_CTX *mdContext;
     mdContext->digest[ii+3] =
       (unsigned char)((mdContext->buf[i] >> 24) & 0xFF);
   }
+  memcpy(hash, mdContext->digest, 16);
 }
 
 /* Basic MD5 step. Transforms buf based on in.