Skip to content

Commit

Permalink
Bug 1034979 - WeaveCrypto unable to initialize on Mac with Brew's sys…
Browse files Browse the repository at this point in the history
…tem NSS installed. r=rnewman, sr=dolske
  • Loading branch information
l-hedgehog committed Oct 10, 2014
1 parent 9da15c8 commit 79813d7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
21 changes: 10 additions & 11 deletions services/crypto/modules/WeaveCrypto.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,16 @@ WeaveCrypto.prototype = {

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

this.log("Initializing NSS types and function declarations...");

Expand Down
6 changes: 6 additions & 0 deletions services/crypto/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,15 @@ TEST_DIRS += ['tests']

EXTRA_JS_MODULES['services-crypto'] += [
'modules/utils.js',
]

EXTRA_PP_JS_MODULES['services-crypto'] += [
'modules/WeaveCrypto.js',
]

EXTRA_COMPONENTS += [
'cryptoComponents.manifest',
]

if CONFIG['MOZ_NATIVE_NSS']:
DEFINES['MOZ_NATIVE_NSS'] = 1

0 comments on commit 79813d7

Please sign in to comment.