diff --git a/openssl-1.0.0c-apps-ipv6listen.patch b/openssl-1.0.0c-apps-ipv6listen.patch deleted file mode 100644 index 7c3d4a0..0000000 --- a/openssl-1.0.0c-apps-ipv6listen.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -up openssl-1.0.0c/apps/s_socket.c.ipv6listen openssl-1.0.0c/apps/s_socket.c ---- openssl-1.0.0c/apps/s_socket.c.ipv6listen 2011-01-24 16:44:18.000000000 +0100 -+++ openssl-1.0.0c/apps/s_socket.c 2011-01-24 16:56:25.000000000 +0100 -@@ -335,15 +335,16 @@ int do_server(char *port, int type, int - - static int init_server(int *sock, char *port, int type) - { -- struct addrinfo *res, *res0, hints; -+ struct addrinfo *res, *res0 = NULL, hints; - char * failed_call = NULL; -- char port_name[8]; - int s; - int e; - - if (!ssl_sock_init()) return(0); - - memset(&hints, '\0', sizeof(hints)); -+ hints.ai_family = AF_INET6; -+tryipv4: - hints.ai_socktype = type; - hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; - -@@ -365,6 +366,12 @@ static int init_server(int *sock, char * - failed_call = "socket"; - goto nextres; - } -+ if (hints.ai_family == AF_INET6) -+ { -+ int j = 0; -+ setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, -+ (void *) &j, sizeof j); -+ } - #if defined SOL_SOCKET && defined SO_REUSEADDR - { - int j = 1; -@@ -392,9 +399,19 @@ nextres: - close(s); - res = res->ai_next; - } -- freeaddrinfo(res0); -+ if (res0) -+ freeaddrinfo(res0); - -- if (s == INVALID_SOCKET) { perror("socket"); return(0); } -+ if (s == INVALID_SOCKET) -+ { -+ if (hints.ai_family == AF_INET6) -+ { -+ hints.ai_family = AF_INET; -+ goto tryipv4; -+ } -+ perror("socket"); -+ return(0); -+ } - - perror(failed_call); - return(0); diff --git a/openssl-1.0.0j-apps-ipv6listen.patch b/openssl-1.0.0j-apps-ipv6listen.patch new file mode 100644 index 0000000..33be092 --- /dev/null +++ b/openssl-1.0.0j-apps-ipv6listen.patch @@ -0,0 +1,78 @@ +diff -up openssl-1.0.0j/apps/s_socket.c.ipv6listen openssl-1.0.0j/apps/s_socket.c +--- openssl-1.0.0j/apps/s_socket.c.ipv6listen 2012-05-15 20:24:08.641893509 +0200 ++++ openssl-1.0.0j/apps/s_socket.c 2012-07-12 11:49:23.220298894 +0200 +@@ -335,25 +335,31 @@ int do_server(char *port, int type, int + + static int init_server(int *sock, char *port, int type) + { +- struct addrinfo *res, *res0, hints; ++ struct addrinfo *res, *res0 = NULL, hints; + char * failed_call = NULL; +- char port_name[8]; +- int s; ++ int s = INVALID_SOCKET; + int e; + + if (!ssl_sock_init()) return(0); + + memset(&hints, '\0', sizeof(hints)); ++ hints.ai_family = AF_INET6; ++tryipv4: + hints.ai_socktype = type; +- hints.ai_flags = AI_PASSIVE | AI_ADDRCONFIG; ++ hints.ai_flags = AI_PASSIVE; + + e = getaddrinfo(NULL, port, &hints, &res); + if (e) + { +- fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e)); +- if (e == EAI_SYSTEM) +- perror("getaddrinfo"); +- return (0); ++ if (hints.ai_family == AF_INET) ++ { ++ fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(e)); ++ if (e == EAI_SYSTEM) ++ perror("getaddrinfo"); ++ return (0); ++ } ++ else ++ res = NULL; + } + + res0 = res; +@@ -365,6 +371,12 @@ static int init_server(int *sock, char * + failed_call = "socket"; + goto nextres; + } ++ if (hints.ai_family == AF_INET6) ++ { ++ int j = 0; ++ setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, ++ (void *) &j, sizeof j); ++ } + #if defined SOL_SOCKET && defined SO_REUSEADDR + { + int j = 1; +@@ -392,9 +404,19 @@ nextres: + close(s); + res = res->ai_next; + } +- freeaddrinfo(res0); ++ if (res0) ++ freeaddrinfo(res0); + +- if (s == INVALID_SOCKET) { perror("socket"); return(0); } ++ if (s == INVALID_SOCKET) ++ { ++ if (hints.ai_family == AF_INET6) ++ { ++ hints.ai_family = AF_INET; ++ goto tryipv4; ++ } ++ perror("socket"); ++ return(0); ++ } + + perror(failed_call); + return(0); diff --git a/openssl.spec b/openssl.spec index 02e2c94..c03cc34 100644 --- a/openssl.spec +++ b/openssl.spec @@ -21,7 +21,7 @@ Summary: A general purpose cryptography library with TLS implementation Name: openssl Version: 1.0.0j -Release: 1%{?dist} +Release: 2%{?dist} Epoch: 1 # We have to remove certain patented algorithms from the openssl source # tarball with the hobble-openssl script which is included below. @@ -64,7 +64,7 @@ Patch51: openssl-1.0.0j-version.patch Patch52: openssl-1.0.0b-aesni.patch Patch53: openssl-1.0.0-name-hash.patch Patch54: openssl-1.0.0c-speed-fips.patch -Patch55: openssl-1.0.0c-apps-ipv6listen.patch +Patch55: openssl-1.0.0j-apps-ipv6listen.patch Patch56: openssl-1.0.0c-rsa-x931.patch Patch57: openssl-1.0.0c-fips186-3.patch Patch58: openssl-1.0.0c-fips-md5-allow.patch @@ -424,6 +424,9 @@ rm -rf $RPM_BUILD_ROOT/%{_libdir}/fipscanister.* %postun -p /sbin/ldconfig %changelog +* Thu Jul 12 2012 Tomas Mraz 1.0.0j-2 +- fix s_server with new glibc when no global IPv6 address (#839031) + * Tue May 15 2012 Tomas Mraz 1.0.0j-1 - new upstream release fixing CVE-2012-2333 - improper record length checking in DTLS