| 1 | Index: openssl/crypto/evp/e_rc4_hmac_md5.c |
| 2 | RCS File: /v/openssl/cvs/openssl/crypto/evp/e_rc4_hmac_md5.c,v |
| 3 | rcsdiff -q -kk '-r1.1.2.5' '-r1.1.2.6' -u '/v/openssl/cvs/openssl/crypto/evp/e_rc4_hmac_md5.c,v' 2>/dev/null |
| 4 | --- crypto/evp/e_rc4_hmac_md5.c 2012/04/18 17:51:33 1.1.2.5 |
| 5 | +++ crypto/evp/e_rc4_hmac_md5.c 2012/04/19 20:43:02 1.1.2.6 |
| 6 | @@ -121,6 +121,7 @@ |
| 7 | md5_off = MD5_CBLOCK-key->md.num, |
| 8 | blocks; |
| 9 | unsigned int l; |
| 10 | + extern unsigned int OPENSSL_ia32cap_P[]; |
| 11 | #endif |
| 12 | size_t plen = key->payload_length; |
| 13 | |
| 14 | @@ -132,7 +133,8 @@ |
| 15 | /* cipher has to "fall behind" */ |
| 16 | if (rc4_off>md5_off) md5_off+=MD5_CBLOCK; |
| 17 | |
| 18 | - if (plen>md5_off && (blocks=(plen-md5_off)/MD5_CBLOCK)) { |
| 19 | + if (plen>md5_off && (blocks=(plen-md5_off)/MD5_CBLOCK) && |
| 20 | + (OPENSSL_ia32cap_P[0]&(1<<20))==0) { |
| 21 | MD5_Update(&key->md,in,md5_off); |
| 22 | RC4(&key->ks,rc4_off,in,out); |
| 23 | |
| 24 | @@ -172,7 +174,8 @@ |
| 25 | if (md5_off>rc4_off) rc4_off += 2*MD5_CBLOCK; |
| 26 | else rc4_off += MD5_CBLOCK; |
| 27 | |
| 28 | - if (len>rc4_off && (blocks=(len-rc4_off)/MD5_CBLOCK)) { |
| 29 | + if (len>rc4_off && (blocks=(len-rc4_off)/MD5_CBLOCK) && |
| 30 | + (OPENSSL_ia32cap_P[0]&(1<<20))==0) { |
| 31 | RC4(&key->ks,rc4_off,in,out); |
| 32 | MD5_Update(&key->md,out,md5_off); |
| 33 | |
| 34 | @@ -289,8 +292,6 @@ |
| 35 | |
| 36 | const EVP_CIPHER *EVP_rc4_hmac_md5(void) |
| 37 | { |
| 38 | - extern unsigned int OPENSSL_ia32cap_P[]; |
| 39 | - /* RC4_CHAR flag ------------vvvvv */ |
| 40 | - return(OPENSSL_ia32cap_P[0]&(1<<20) ? NULL : &r4_hmac_md5_cipher); |
| 41 | + return(&r4_hmac_md5_cipher); |
| 42 | } |
| 43 | #endif |