OpenSSL's SHA1Transform takes different arguments than our
authoraland <aland>
Thu, 5 Jun 2008 12:17:33 +0000 (12:17 +0000)
committeraland <aland>
Thu, 5 Jun 2008 12:17:33 +0000 (12:17 +0000)
function.

Note that OpenSSL also doesn't have a SHA1FinalNoLen function...

src/modules/rlm_eap/libeap/fips186prf.c

index 6a262ae..559754c 100644 (file)
@@ -138,7 +138,11 @@ void fips186_2prf(uint8_t mk[20], uint8_t finalkey[160])
 
                memset(zeros, 0, sizeof(zeros));
                memcpy(zeros, xval.p, 20);
+#ifndef WITH_OPENSSL_SHA1
                fr_SHA1Transform(context.state, zeros);
+#else
+               fr_SHA1Transform(&context, zeros);
+#endif
                fr_SHA1FinalNoLen(w_0.p, &context);
 
                /*   c. XKEY = (1 + XKEY + w_0) mod 2^160 */
@@ -153,7 +157,11 @@ void fips186_2prf(uint8_t mk[20], uint8_t finalkey[160])
 
                memset(zeros, 0, sizeof(zeros));
                memcpy(zeros, xval.p, 20);
+#ifndef WITH_OPENSSL_SHA1
                fr_SHA1Transform(context.state, zeros);
+#else
+               fr_SHA1Transform(&context, zeros);
+#endif
                fr_SHA1FinalNoLen(w_1.p, &context);
 
                /*   f. XKEY = (1 + XKEY + w_1) mod 2^160 */