Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-1.9.git;a=commitdiff;h=1988d6a2e08b993ba96cbfb34243eaee0770a968
commit 1988d6a2e08b993ba96cbfb34243eaee0770a968 Author: kikadf <[email protected]> Date: Thu Mar 13 09:15:29 2014 +0100 libssh-0.5.3-2arcturus1-x86_64 * Fix CVE-2013-0176, CVE-2014-0017 diff --git a/source/lib/libssh/CVE-2013-0176.patch b/source/lib/libssh/CVE-2013-0176.patch new file mode 100644 index 0000000..79aa8e3 --- /dev/null +++ b/source/lib/libssh/CVE-2013-0176.patch @@ -0,0 +1,47 @@ +From 55b09f426417406bb25c0b9c474fbab1398b0dc8 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider <[email protected]> +Date: Wed, 09 Jan 2013 12:20:02 +0000 +Subject: CVE-2013-0176: Fix a remote DoS if the client doesn't send a matching kex. + +Thanks to Yong Chuan Koh, X-Force Research <[email protected]> +--- +diff --git a/src/server.c b/src/server.c +index 131a2bc..b4fb189 100644 +--- a/src/server.c ++++ b/src/server.c +@@ -184,7 +184,11 @@ static int dh_handshake_server(ssh_session session) { + prv = session->rsa_key; + break; + default: +- prv = NULL; ++ ssh_set_error(session, ++ SSH_FATAL, ++ "Could determine the specified hostkey"); ++ ssh_string_free(f); ++ return -1; + } + + pub = publickey_from_privatekey(prv); +@@ -270,6 +274,8 @@ static int dh_handshake_server(ssh_session session) { + */ + static void ssh_server_connection_callback(ssh_session session){ + int ssh1,ssh2; ++ int rc; ++ + enter_function(); + switch(session->session_state){ + case SSH_SESSION_STATE_NONE: +@@ -338,7 +344,10 @@ static void ssh_server_connection_callback(ssh_session session){ + case SSH_SESSION_STATE_KEXINIT_RECEIVED: + set_status(session,0.6f); + ssh_list_kex(session, &session->client_kex); // log client kex +- crypt_set_algorithms_server(session); ++ rc = crypt_set_algorithms_server(session); ++ if (rc == SSH_ERROR) { ++ goto error; ++ } + if (set_kex(session) < 0) { + goto error; + } +-- +cgit v0.9.0.2 diff --git a/source/lib/libssh/CVE-2014-0017.patch b/source/lib/libssh/CVE-2014-0017.patch new file mode 100644 index 0000000..fd81255 --- /dev/null +++ b/source/lib/libssh/CVE-2014-0017.patch @@ -0,0 +1,87 @@ +Backport of: + +From e99246246b4061f7e71463f8806b9dcad65affa0 Mon Sep 17 00:00:00 2001 +From: Aris Adamantiadis <[email protected]> +Date: Wed, 05 Feb 2014 20:24:12 +0000 +Subject: security: fix for vulnerability CVE-2014-0017 + +When accepting a new connection, a forking server based on libssh forks +and the child process handles the request. The RAND_bytes() function of +openssl doesn't reset its state after the fork, but simply adds the +current process id (getpid) to the PRNG state, which is not guaranteed +to be unique. +This can cause several children to end up with same PRNG state which is +a security issue. +--- +Index: libssh-0.5.4/include/libssh/wrapper.h +=================================================================== +--- libssh-0.5.4.orig/include/libssh/wrapper.h 2014-03-10 09:50:49.105944378 -0400 ++++ libssh-0.5.4/include/libssh/wrapper.h 2014-03-10 09:50:49.081944377 -0400 +@@ -44,5 +44,6 @@ + struct ssh_crypto_struct *crypto_new(void); + void crypto_free(struct ssh_crypto_struct *crypto); + ++void ssh_reseed(void); + + #endif /* WRAPPER_H_ */ +Index: libssh-0.5.4/src/bind.c +=================================================================== +--- libssh-0.5.4.orig/src/bind.c 2014-03-10 09:50:49.105944378 -0400 ++++ libssh-0.5.4/src/bind.c 2014-03-10 09:51:34.789946084 -0400 +@@ -375,6 +375,8 @@ + session->dsa_key = dsa; + session->rsa_key = rsa; + ++ /* force PRNG to change state in case we fork after ssh_bind_accept */ ++ ssh_reseed(); + return SSH_OK; + } + +Index: libssh-0.5.4/src/libcrypto.c +=================================================================== +--- libssh-0.5.4.orig/src/libcrypto.c 2014-03-10 09:50:49.105944378 -0400 ++++ libssh-0.5.4/src/libcrypto.c 2014-03-10 09:50:49.085944377 -0400 +@@ -23,6 +23,7 @@ + #include <stdlib.h> + #include <stdio.h> + #include <string.h> ++#include <sys/time.h> + + #include "libssh/priv.h" + #include "libssh/session.h" +@@ -38,6 +39,8 @@ + #include <openssl/rsa.h> + #include <openssl/hmac.h> + #include <openssl/opensslv.h> ++#include <openssl/rand.h> ++ + #ifdef HAVE_OPENSSL_AES_H + #define HAS_AES + #include <openssl/aes.h> +@@ -66,6 +69,12 @@ + return 0; + } + ++void ssh_reseed(void){ ++ struct timeval tv; ++ gettimeofday(&tv, NULL); ++ RAND_add(&tv, sizeof(tv), 0.0); ++} ++ + SHACTX sha1_init(void) { + SHACTX c = malloc(sizeof(*c)); + if (c == NULL) { +Index: libssh-0.5.4/src/libgcrypt.c +=================================================================== +--- libssh-0.5.4.orig/src/libgcrypt.c 2014-03-10 09:50:49.105944378 -0400 ++++ libssh-0.5.4/src/libgcrypt.c 2014-03-10 09:50:49.085944377 -0400 +@@ -41,6 +41,9 @@ + return 0; + } + ++void ssh_reseed(void){ ++ } ++ + SHACTX sha1_init(void) { + SHACTX ctx = NULL; + gcry_md_open(&ctx, GCRY_MD_SHA1, 0); diff --git a/source/lib/libssh/FrugalBuild b/source/lib/libssh/FrugalBuild index cf8e7c4..907d544 100644 --- a/source/lib/libssh/FrugalBuild +++ b/source/lib/libssh/FrugalBuild @@ -1,9 +1,11 @@ # Compiling Time: 0.18 SBU # Maintainer: Miklos Vajna <[email protected]> +options+=('asneeded') + pkgname=libssh pkgver=0.5.3 -pkgrel=1 +pkgrel=2arcturus1 pkgdesc="The SSH library" url="http://www.libssh.org/" depends=('openssl>=1.0.0' 'zlib') @@ -13,4 +15,11 @@ up2date="Flasttar $url/files/${pkgver%%.?}" source=($url/files/${pkgver%%.?}/libssh-$pkgver.tar.gz) sha1sums=('63f5f9e7d8b8e936048a51998a6f9be0e86866a7') Finclude cmake + +# FSA fix *** +source=(${source[@]} CVE-2013-0176.patch CVE-2014-0017.patch) +sha1sums=(${sha1sums[@]} '97d39d528276a498358fee3196810a6ea6113048' \ + 'cf75f2af68d8d82be628bed64a060d5665d8c593') +# *********** + # optimization OK _______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
