c260e0
From 311a22b801693bf8b748169f35bde7bef744da8c Mon Sep 17 00:00:00 2001
c260e0
From: Kamil Dudka <kdudka@redhat.com>
c260e0
Date: Wed, 29 Jan 2014 12:55:36 +0100
c260e0
Subject: [PATCH 1/2] nss: do not fail if NSS does not implement a cipher
c260e0
c260e0
... that the user does not ask for
c260e0
c260e0
[upstream commit e15e73b741a2ddc88d166d2cec86d2bebb5d349e]
c260e0
---
c260e0
 lib/nss.c |    9 +++++----
c260e0
 1 files changed, 5 insertions(+), 4 deletions(-)
c260e0
c260e0
diff --git a/lib/nss.c b/lib/nss.c
c260e0
index a2c5c63..c4ffe7b 100644
c260e0
--- a/lib/nss.c
c260e0
+++ b/lib/nss.c
c260e0
@@ -192,14 +192,13 @@ static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model,
c260e0
   PRBool cipher_state[NUM_OF_CIPHERS];
c260e0
   PRBool found;
c260e0
   char *cipher;
c260e0
-  SECStatus rv;
c260e0
 
c260e0
   /* First disable all ciphers. This uses a different max value in case
c260e0
    * NSS adds more ciphers later we don't want them available by
c260e0
    * accident
c260e0
    */
c260e0
   for(i=0; i
c260e0
-    SSL_CipherPrefSet(model, SSL_ImplementedCiphers[i], SSL_NOT_ALLOWED);
c260e0
+    SSL_CipherPrefSet(model, SSL_ImplementedCiphers[i], PR_FALSE);
c260e0
   }
c260e0
 
c260e0
   /* Set every entry in our list to false */
c260e0
@@ -239,8 +238,10 @@ static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model,
c260e0
 
c260e0
   /* Finally actually enable the selected ciphers */
c260e0
   for(i=0; i
c260e0
-    rv = SSL_CipherPrefSet(model, cipherlist[i].num, cipher_state[i]);
c260e0
-    if(rv != SECSuccess) {
c260e0
+    if(!cipher_state[i])
c260e0
+      continue;
c260e0
+
c260e0
+    if(SSL_CipherPrefSet(model, cipherlist[i].num, PR_TRUE) != SECSuccess) {
c260e0
       failf(data, "cipher-suite not supported by NSS: %s", cipherlist[i].name);
c260e0
       return SECFailure;
c260e0
     }
c260e0
-- 
c260e0
1.7.1
c260e0
c260e0
c260e0
From 9fe38c72787ba6658456a30477d48fe7960947ed Mon Sep 17 00:00:00 2001
c260e0
From: Kamil Dudka <kdudka@redhat.com>
c260e0
Date: Wed, 29 Jan 2014 13:03:46 +0100
c260e0
Subject: [PATCH 2/2] nss: do not use the NSS_ENABLE_ECC define
c260e0
c260e0
It is not provided by NSS public headers.
c260e0
c260e0
Bug: https://bugzilla.redhat.com/1058776
c260e0
c260e0
[upstream commit 665c160f0a4635565b44704ca281d2a03e715d6d]
c260e0
---
c260e0
 lib/nss.c |    2 --
c260e0
 1 files changed, 0 insertions(+), 2 deletions(-)
c260e0
c260e0
diff --git a/lib/nss.c b/lib/nss.c
c260e0
index c4ffe7b..111982f 100644
c260e0
--- a/lib/nss.c
c260e0
+++ b/lib/nss.c
c260e0
@@ -126,7 +126,6 @@ static const cipher_s cipherlist[] = {
c260e0
   /* AES ciphers. */
c260e0
   {"rsa_aes_128_sha",            TLS_RSA_WITH_AES_128_CBC_SHA},
c260e0
   {"rsa_aes_256_sha",            TLS_RSA_WITH_AES_256_CBC_SHA},
c260e0
-#ifdef NSS_ENABLE_ECC
c260e0
   /* ECC ciphers. */
c260e0
   {"ecdh_ecdsa_null_sha",        TLS_ECDH_ECDSA_WITH_NULL_SHA},
c260e0
   {"ecdh_ecdsa_rc4_128_sha",     TLS_ECDH_ECDSA_WITH_RC4_128_SHA},
c260e0
@@ -153,7 +152,6 @@ static const cipher_s cipherlist[] = {
c260e0
   {"ecdh_anon_3des_sha",         TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA},
c260e0
   {"ecdh_anon_aes_128_sha",      TLS_ECDH_anon_WITH_AES_128_CBC_SHA},
c260e0
   {"ecdh_anon_aes_256_sha",      TLS_ECDH_anon_WITH_AES_256_CBC_SHA},
c260e0
-#endif
c260e0
 };
c260e0
 
c260e0
 /* following ciphers are new in NSS 3.4 and not enabled by default, therefore
c260e0
-- 
c260e0
1.7.1
c260e0