From 7380433d6a2f4aaec8dfcacfffadc260b417c7a3 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 4 Sep 2015 14:35:36 +0200 Subject: nss: do not directly access SSL_ImplementedCiphers[] It causes dynamic linking issues at run-time after an update of NSS. Bug: https://lists.fedoraproject.org/pipermail/devel/2015-September/214117.html --- lib/vtls/nss.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/vtls/nss.c b/lib/vtls/nss.c index 91727c7c3..c66c60b56 100644 --- a/lib/vtls/nss.c +++ b/lib/vtls/nss.c @@ -211,16 +211,22 @@ static SECStatus set_ciphers(struct SessionHandle *data, PRFileDesc * model, PRBool found; char *cipher; + /* use accessors to avoid dynamic linking issues after an update of NSS */ + const PRUint16 num_implemented_ciphers = SSL_GetNumImplementedCiphers(); + const PRUint16 *implemented_ciphers = SSL_GetImplementedCiphers(); + if(!implemented_ciphers) + return SECFailure; + /* First disable all ciphers. This uses a different max value in case * NSS adds more ciphers later we don't want them available by * accident */ - for(i=0; i