Ticket #34135: patch-min-openssl-1.0.1a-patchset_22455.diff

File patch-min-openssl-1.0.1a-patchset_22455.diff, 2.3 KB (added by pixilla (Bradley Giesbrecht), 12 years ago)

This patch only adds the openssl.org openssl_patchset_22455.diff patch. This patch does not clean up the "Hunk" warnings present in the existing openssl patches. Produce the same patched sources as my previously uploaded patch-openssl-1.0.1a-patchset_22455.diff patch.

  • files/patch-openssl_patchset_22455.diff

     
     1Index: openssl/crypto/evp/e_rc4_hmac_md5.c
     2RCS File: /v/openssl/cvs/openssl/crypto/evp/e_rc4_hmac_md5.c,v
     3rcsdiff -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
  • Portfile

     
    3030depends_lib         port:zlib
    3131
    3232patchfiles          patch-Makefile.org.diff patch-crypto-Makefile.diff patch-bn_internal.pod.diff patch-Configure.diff
     33
     34# Add openssl.org patchset 22455
     35# http://cvs.openssl.org/chngview?cn=22455
     36patchfiles-append   patch-openssl_patchset_22455.diff
     37
    3338post-patch {
    3439    # Ensure that the correct compiler is used
    3540    reinplace "s|cc:|${configure.cc}:|" ${worksrcpath}/Configure