Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Oct 2007 20:36:43 -0400
From:      "Tamouh H." <hakmi@rogers.com>
To:        <freebsd-questions@freebsd.org>
Subject:   recent openssl patch is failing
Message-ID:  <063401c806e7$ce145470$6900a8c0@tamouh>

next in thread | raw e-mail | index | archive | help


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
|=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D

This is what ssl_lib.c.rej shows:

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

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D

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







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?063401c806e7$ce145470$6900a8c0>