diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-27 03:37:29 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-06-27 03:37:29 +0200 |
commit | 95ab8db84ce41bec9b4d269ef6539f3e4950b3b9 (patch) | |
tree | 68185aaceae15ee718ed2975907aa92ad56cc460 /security/nss/lib/softoken/lgglue.c | |
parent | 7715dd79c5e38cd0de3b3092fbacd6146146a028 (diff) | |
parent | 3c568a5681bac0a84f7a49697951780170ad182c (diff) | |
download | UXP-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.c | 12 |
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); |