wok-next view aircrack-ng/stuff/patches/9a1846507ff043c397257206ff21adae90a122f4.patch @ rev 20916
libopenraw, abiword: update deps; boost: pack unpacked libs
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Aug 21 05:42:25 2018 +0300 (2018-08-21) |
parents | |
children |
line source
1 From 9a1846507ff043c397257206ff21adae90a122f4 Mon Sep 17 00:00:00 2001
2 From: Thomas d'Otreppe <tdotreppe@aircrack-ng.org>
3 Date: Wed, 21 Dec 2016 00:18:46 +0000
4 Subject: [PATCH] Fixed compilation with OpenSSL 1.1.0 (Closes: #1711).
6 git-svn-id: http://svn.aircrack-ng.org/trunk@2882 28c6078b-6c39-48e3-add9-af49d547ecab
7 ---
8 src/crypto.c | 23 +++++++++++++++++++++++
9 1 file changed, 23 insertions(+)
11 diff --git a/src/crypto.c b/src/crypto.c
12 index c331875..46fa9c5 100644
13 --- a/src/crypto.c
14 +++ b/src/crypto.c
15 @@ -288,7 +288,15 @@ void calc_pmk( char *key, char *essid_pre, unsigned char pmk[40] )
16 void calc_mic (struct AP_info *ap, unsigned char pmk[32], unsigned char ptk[80], unsigned char mic[20]) {
17 int i;
18 unsigned char pke[100];
19 + #if defined(USE_GCRYPT) || OPENSSL_VERSION_NUMBER < 0x10100000L
20 + #define HMAC_USE_NO_PTR
21 + #endif
22 +
23 + #ifdef HMAC_USE_NO_PTR
24 HMAC_CTX ctx;
25 + #else
26 + HMAC_CTX * ctx;
27 + #endif
29 memcpy( pke, "Pairwise key expansion", 23 );
31 @@ -314,6 +322,7 @@ void calc_mic (struct AP_info *ap, unsigned char pmk[32], unsigned char ptk[80],
32 memcpy( pke + 67, ap->wpa.snonce, 32 );
33 }
35 + #ifdef HMAC_USE_NO_PTR
36 HMAC_CTX_init(&ctx);
37 HMAC_Init_ex(&ctx, pmk, 32, EVP_sha1(), NULL);
38 for(i = 0; i < 4; i++ )
39 @@ -325,6 +334,20 @@ void calc_mic (struct AP_info *ap, unsigned char pmk[32], unsigned char ptk[80],
40 HMAC_Final(&ctx, ptk + i*20, NULL);
41 }
42 HMAC_CTX_cleanup(&ctx);
43 + #else
44 + ctx = HMAC_CTX_new();
45 + HMAC_Init_ex(ctx, pmk, 32, EVP_sha1(), NULL);
46 + for(i = 0; i < 4; i++ )
47 + {
48 + pke[99] = i;
49 + //HMAC(EVP_sha1(), values[0], 32, pke, 100, ptk + i * 20, NULL);
50 + HMAC_Init_ex(ctx, 0, 0, 0, 0);
51 + HMAC_Update(ctx, pke, 100);
52 + HMAC_Final(ctx, ptk + i*20, NULL);
53 + }
54 + HMAC_CTX_free(ctx);
55 + #endif
56 + #undef HMAC_USE_NO_PTR
58 if( ap->wpa.keyver == 1 )
59 {