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