Skip to content

Commit

Permalink
Switch to checking for AES_KEY_WRAP by default
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Scheel <[email protected]>
  • Loading branch information
cipherboy committed Feb 24, 2021
1 parent e45b5dc commit 4446afe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions org/mozilla/jss/pkcs11/PK11KeyWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -886,17 +886,17 @@ CK_MECHANISM_TYPE getSupportedWrappingMechanism(JNIEnv *env, jobject algObj, PK1
*/
if ( mech == CKM_AES_KEY_WRAP ||
mech == CKM_NSS_AES_KEY_WRAP) {
if (!PK11_DoesMechanism(slot, CKM_AES_KEY_WRAP)) {
mech = CKM_NSS_AES_KEY_WRAP;
} else {
if (PK11_DoesMechanism(slot, CKM_AES_KEY_WRAP)) {
mech = CKM_AES_KEY_WRAP;
} else {
mech = CKM_NSS_AES_KEY_WRAP;
}
} else if ( mech == CKM_AES_KEY_WRAP_PAD
|| mech == CKM_NSS_AES_KEY_WRAP_PAD) {
if (!PK11_DoesMechanism(slot, CKM_AES_KEY_WRAP_PAD)) {
mech = CKM_NSS_AES_KEY_WRAP_PAD;
} else {
if (PK11_DoesMechanism(slot, CKM_AES_KEY_WRAP_PAD)) {
mech = CKM_AES_KEY_WRAP_PAD;
} else {
mech = CKM_NSS_AES_KEY_WRAP_PAD;
}
}
return mech;
Expand Down

0 comments on commit 4446afe

Please sign in to comment.