Bug 1034979 - WeaveCrypto unable to initialize on Mac with Brew's system NSS installed. r=rnewman, sr=dolske

This commit is contained in:
Hector Zhao 2014-10-10 18:15:22 +08:00
parent e47e83bb8b
commit 901b4d75a7
2 changed files with 16 additions and 11 deletions

View File

@ -132,17 +132,16 @@ WeaveCrypto.prototype = {
// XXX really want to be able to pass specific dlopen flags here. // XXX really want to be able to pass specific dlopen flags here.
var nsslib; var nsslib;
try { #ifdef MOZ_NATIVE_NSS
this.log("Trying NSS library without path"); // Search platform-dependent library paths for system NSS.
nsslib = ctypes.open(path); this.log("Trying NSS library without path");
} catch(e) { nsslib = ctypes.open(path);
// In case opening the library without a full path fails, #else
// try again with a full path. let file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile);
let file = Services.dirsvc.get("GreBinD", Ci.nsILocalFile); file.append(path);
file.append(path); this.log("Trying NSS library with path " + file.path);
this.log("Trying again with path " + file.path); nsslib = ctypes.open(file.path);
nsslib = ctypes.open(file.path); #endif
}
this.log("Initializing NSS types and function declarations..."); this.log("Initializing NSS types and function declarations...");

View File

@ -9,9 +9,15 @@ TEST_DIRS += ['tests']
EXTRA_JS_MODULES['services-crypto'] += [ EXTRA_JS_MODULES['services-crypto'] += [
'modules/utils.js', 'modules/utils.js',
]
EXTRA_PP_JS_MODULES['services-crypto'] += [
'modules/WeaveCrypto.js', 'modules/WeaveCrypto.js',
] ]
EXTRA_COMPONENTS += [ EXTRA_COMPONENTS += [
'cryptoComponents.manifest', 'cryptoComponents.manifest',
] ]
if CONFIG['MOZ_NATIVE_NSS']:
DEFINES['MOZ_NATIVE_NSS'] = 1