recent openssl patch is failing

Tamouh H. hakmi at rogers.com
Thu Oct 4 17:35:16 PDT 2007



Hello,

I've tried patching the latest openssl on FreeBSD 6.1 as per:

http://security.freebsd.org/advisories/FreeBSD-SA-07:08.openssl.asc

However, the patching fails mainly due to some problems with the patch on line 1162 , and I can't seem to find out the reason for it. This had failed on multiple FBSD machines, so I'm pretty sure it is the patch.

Here is what the patch is producing:

openssl.patch                                 100% of 1051  B 5237 kBps
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|Index: crypto/openssl/ssl/ssl_lib.c
|===================================================================
|RCS file: /home/ncvs/src/crypto/openssl/ssl/ssl_lib.c,v
|retrieving revision 1.1.1.12.2.1
|diff -u -d -r1.1.1.12.2.1 ssl_lib.c
|--- crypto/openssl/ssl/ssl_lib.c       28 Sep 2006 13:02:36 -0000      1.1.1.12.2.1
|+++ crypto/openssl/ssl/ssl_lib.c       3 Oct 2007 17:01:24 -0000
--------------------------
Patching file crypto/openssl/ssl/ssl_lib.c using Plan A...
Hunk #1 succeeded at 1149.
Hunk #2 failed at 1161.
1 out of 2 hunks failed--saving rejects to crypto/openssl/ssl/ssl_lib.c.rej
done

==================

This is what ssl_lib.c.rej shows:

***************
*** 1162,1181 ****
        sk=s->session->ciphers;
        for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
                {
-               /* Decrement for either the ':' or a '\0' */
-               len--;
                c=sk_SSL_CIPHER_value(sk,i);
-               for (cp=c->name; *cp; )
                        {
-                       if (len-- <= 0)
-                               {
-                               *p='\0';
-                               return(buf);
-                               }
-                       else
-                               *(p++)= *(cp++);
                        }
                *(p++)=':';
                }
        p[-1]='\0';
        return(buf);
--- 1161,1181 ----
        sk=s->session->ciphers;
        for (i=0; i<sk_SSL_CIPHER_num(sk); i++)
                {
+               int n;
+
                c=sk_SSL_CIPHER_value(sk,i);
+               n=strlen(c->name);
+               if (n+1 > len)
                        {
+                       if (p != buf)
+                               --p;
+                       *p='\0';
+                       return buf;
                        }
+               strcpy(p,c->name);
+               p+=n;
                *(p++)=':';
+               len-=n+1;
                }
        p[-1]='\0';
        return(buf);

==========================

This is the error when doing make:

/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c: In function `SSL_get_shared_ciphers':
/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c:1167: error: `cp' undeclared (first use in this function)
/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c:1167: error: (Each undeclared identifier is reported only once
/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/ssl_lib.c:1167: error: for each function it appears in.)
*** Error code 1


Anyone have tried the patch and experiencing the same issue ?

Thanks,

Tamouh Hakmi






More information about the freebsd-questions mailing list