summaryrefslogtreecommitdiff
path: root/security/john
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2019-03-07 15:02:36 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2019-03-07 15:02:36 +0000
commitbbb8ccee213c80ec6d939ada34d12a7f7635650d (patch)
tree805bcf2ef057b3369a5bc6ac60a9e6d3116ceb3b /security/john
parentsecurity/softether-devel: Mark as IGNORE (diff)
Drop OpenSSL dependency from WPA-PSK format support code.
Obtained from: https://github.com/magnumripper/JohnTheRipper/commit/a286ca6
Notes
Notes: svn path=/head/; revision=494952
Diffstat (limited to 'security/john')
-rw-r--r--security/john/files/patch-wpapsk.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/security/john/files/patch-wpapsk.h b/security/john/files/patch-wpapsk.h
new file mode 100644
index 000000000000..3cea05c77ae8
--- /dev/null
+++ b/security/john/files/patch-wpapsk.h
@@ -0,0 +1,62 @@
+--- wpapsk.h.orig 2014-10-03 01:08:17 UTC
++++ wpapsk.h
+@@ -13,6 +13,9 @@
+ #include "arch.h"
+ #include "common.h"
+ #include "johnswap.h"
++#include "md5.h"
++#include "hmacmd5.h"
++#include "pbkdf2_hmac_sha1.h"
+ #include "stdint.h"
+
+ #include <assert.h>
+@@ -200,7 +203,6 @@ static int valid(char *ciphertext, struct fmt_main *se
+ #ifndef JOHN_OCL_WPAPSK
+ static MAYBE_INLINE void prf_512(uint32_t * key, uint8_t * data, uint32_t * ret)
+ {
+- HMAC_CTX ctx;
+ char *text = (char*)"Pairwise key expansion";
+ unsigned char buff[100];
+
+@@ -208,10 +210,7 @@ static MAYBE_INLINE void prf_512(uint32_t * key, uint8
+ memcpy(buff + 23, data, 76);
+ buff[22] = 0;
+ buff[76 + 23] = 0;
+- HMAC_Init(&ctx, key, 32, EVP_sha1());
+- HMAC_Update(&ctx, buff, 100);
+- HMAC_Final(&ctx, (unsigned char *) ret, NULL);
+- HMAC_CTX_cleanup(&ctx);
++ hmac_sha1((unsigned char*)key, 32, buff, 100, (unsigned char*)ret, 20);
+ }
+ #endif
+
+@@ -346,9 +345,12 @@ static void wpapsk_postprocess(int keys)
+ #endif
+ for (i = 0; i < keys; i++) {
+ uint32_t prf[20/4];
++ HMACMD5Context ctx;
++
+ prf_512(outbuffer[i].v, data, prf);
+- HMAC(EVP_md5(), prf, 16, hccap.eapol, hccap.eapol_size,
+- mic[i].keymic, NULL);
++ hmac_md5_init_K16((unsigned char*)prf, &ctx);
++ hmac_md5_update(hccap.eapol, hccap.eapol_size, &ctx);
++ hmac_md5_final(mic[i].keymic, &ctx);
+ }
+ } else {
+ #ifdef _OPENMP
+@@ -356,11 +358,10 @@ static void wpapsk_postprocess(int keys)
+ #endif
+ for (i = 0; i < keys; i++) {
+ uint32_t prf[20/4];
+- unsigned char keymic[20];
++
+ prf_512(outbuffer[i].v, data, prf);
+- HMAC(EVP_sha1(), prf, 16, hccap.eapol,
+- hccap.eapol_size, keymic, NULL);
+- memcpy(mic[i].keymic, keymic, 16);
++ hmac_sha1((unsigned char*)prf, 16, hccap.eapol,
++ hccap.eapol_size, mic[i].keymic, 16);
+ }
+ }
+ }