Bug 1188750 - CryptoKey::ReadStructuredClone() needs to ensure NSS is initialized before trying to deserialize a key r=keeler

This commit is contained in:
Tim Taubert 2015-08-07 14:27:14 +02:00
parent 9397fd91e0
commit 981a809447
2 changed files with 7 additions and 0 deletions

View File

@ -6,6 +6,7 @@
#include "pk11pub.h"
#include "cryptohi.h"
#include "nsNSSComponent.h"
#include "ScopedNSSTypes.h"
#include "mozilla/dom/CryptoKey.h"
#include "mozilla/dom/WebCryptoCommon.h"
@ -1249,6 +1250,11 @@ CryptoKey::ReadStructuredClone(JSStructuredCloneReader* aReader)
return false;
}
// Ensure that NSS is initialized.
if (!EnsureNSSInitializedChromeOrContent()) {
return false;
}
uint32_t version;
CryptoBuffer sym, priv, pub;

View File

@ -27,6 +27,7 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/security/manager/ssl',
'/security/pkix/include',
]
MOCHITEST_MANIFESTS += ['test/mochitest.ini']