summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/softoken/lgglue.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-26 15:13:18 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-26 15:13:18 +0200
commitfbc2eaacd679f0c484993ffe23d786fd06da22c3 (patch)
tree5f78f9cedea413ac9c425ad209f2b03bd7bba323 /security/nss/lib/softoken/lgglue.c
parentd7359c38b197c221c43def1e24cb48d4aee51bba (diff)
downloadUXP-fbc2eaacd679f0c484993ffe23d786fd06da22c3.tar
UXP-fbc2eaacd679f0c484993ffe23d786fd06da22c3.tar.gz
UXP-fbc2eaacd679f0c484993ffe23d786fd06da22c3.tar.lz
UXP-fbc2eaacd679f0c484993ffe23d786fd06da22c3.tar.xz
UXP-fbc2eaacd679f0c484993ffe23d786fd06da22c3.zip
Update NSS to 3.41.1 (custom)
This resolves #82
Diffstat (limited to 'security/nss/lib/softoken/lgglue.c')
-rw-r--r--security/nss/lib/softoken/lgglue.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/security/nss/lib/softoken/lgglue.c b/security/nss/lib/softoken/lgglue.c
index 94f054129..67f17943b 100644
--- a/security/nss/lib/softoken/lgglue.c
+++ b/security/nss/lib/softoken/lgglue.c
@@ -171,6 +171,8 @@ sftkdb_encrypt_stub(PLArenaPool *arena, SDB *sdb, SECItem *plainText,
{
SFTKDBHandle *handle = sdb->app_private;
SECStatus rv;
+ SECItem *key;
+ int iterationCount;
if (handle == NULL) {
return SECFailure;
@@ -192,9 +194,15 @@ sftkdb_encrypt_stub(PLArenaPool *arena, SDB *sdb, SECItem *plainText,
/* PORT_SetError */
return SECFailure;
}
+ if (handle->newKey) {
+ key = handle->newKey;
+ iterationCount = handle->newDefaultIterationCount;
+ } else {
+ key = &handle->passwordKey;
+ iterationCount = handle->defaultIterationCount;
+ }
- rv = sftkdb_EncryptAttribute(arena,
- handle->newKey ? handle->newKey : &handle->passwordKey,
+ rv = sftkdb_EncryptAttribute(arena, key, iterationCount,
plainText, cipherText);
PZ_Unlock(handle->passwordLock);