From bf3c4210d99692c401cfaa298a4cfebdd0962191 Mon Sep 17 00:00:00 2001 From: "dkegel@google.com" Date: Mon, 27 Jul 2009 16:47:12 +0000 Subject: Avoid runtime linker warning "Symbol `SSL_ImplementedCiphers' has different size in shared object, consider re-linking" if SSL_ImplementedCiphers is different size on target system than it was on build system. BUG=12826 TEST=run on Jaunty, look for "Symbol `SSL_ImplementedCiphers' has different size in shared object" in console output Review URL: http://codereview.chromium.org/118367 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21649 0039d316-1c4b-4281-b951-d872f2087c98 --- base/nss_init.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/base/nss_init.cc b/base/nss_init.cc index e39a3a5..15fad89 100644 --- a/base/nss_init.cc +++ b/base/nss_init.cc @@ -4,6 +4,7 @@ #include "base/nss_init.h" +#include #include #include #include @@ -93,12 +94,22 @@ class NSSInitSingleton { NSS_SetDomesticPolicy(); + // Use late binding to avoid scary but benign warning + // "Symbol `SSL_ImplementedCiphers' has different size in shared object, + // consider re-linking" + const PRUint16* pSSL_ImplementedCiphers = static_cast( + dlsym(RTLD_DEFAULT, "SSL_ImplementedCiphers")); + if (pSSL_ImplementedCiphers == NULL) { + NOTREACHED() << "Can't get list of supported ciphers"; + return; + } + // Explicitly enable exactly those ciphers with keys of at least 80 bits for (int i = 0; i < SSL_NumImplementedCiphers; i++) { SSLCipherSuiteInfo info; - if (SSL_GetCipherSuiteInfo(SSL_ImplementedCiphers[i], &info, + if (SSL_GetCipherSuiteInfo(pSSL_ImplementedCiphers[i], &info, sizeof(info)) == SECSuccess) { - SSL_CipherPrefSetDefault(SSL_ImplementedCiphers[i], + SSL_CipherPrefSetDefault(pSSL_ImplementedCiphers[i], (info.effectiveKeyBits >= 80)); } } -- cgit v1.1