summaryrefslogtreecommitdiffstats
path: root/security/nss/lib/softoken/lgglue.c
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-06-27 03:37:29 +0200
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-06-27 03:37:29 +0200
commit95ab8db84ce41bec9b4d269ef6539f3e4950b3b9 (patch)
tree68185aaceae15ee718ed2975907aa92ad56cc460 /security/nss/lib/softoken/lgglue.c
parent7715dd79c5e38cd0de3b3092fbacd6146146a028 (diff)
parent3c568a5681bac0a84f7a49697951780170ad182c (diff)
downloadUXP-95ab8db84ce41bec9b4d269ef6539f3e4950b3b9.tar
UXP-95ab8db84ce41bec9b4d269ef6539f3e4950b3b9.tar.gz
UXP-95ab8db84ce41bec9b4d269ef6539f3e4950b3b9.tar.lz
UXP-95ab8db84ce41bec9b4d269ef6539f3e4950b3b9.tar.xz
UXP-95ab8db84ce41bec9b4d269ef6539f3e4950b3b9.zip
Merge branch 'nss-sftkpwd-update'
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);