Skip to content

Commit b80416b

Browse files
authored
Merge pull request parallaxsecond#254 from ionut-arm/pkcs11-export-fix
Fix attribute conversion in PKCS11 provider
2 parents 82718eb + 7605e41 commit b80416b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/providers/pkcs11_provider/utils.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,11 @@ fn key_pair_usage_flags_to_pkcs11_attributes(
620620
}
621621

622622
if usage_flags.export {
623-
priv_template.push(CK_ATTRIBUTE::new(CKA_EXTRACTABLE).with_bool(&CK_FALSE));
624-
priv_template.push(CK_ATTRIBUTE::new(CKA_SENSITIVE).with_bool(&CK_TRUE));
625-
} else {
626623
priv_template.push(CK_ATTRIBUTE::new(CKA_EXTRACTABLE).with_bool(&CK_TRUE));
627624
priv_template.push(CK_ATTRIBUTE::new(CKA_SENSITIVE).with_bool(&CK_FALSE));
625+
} else {
626+
priv_template.push(CK_ATTRIBUTE::new(CKA_EXTRACTABLE).with_bool(&CK_FALSE));
627+
priv_template.push(CK_ATTRIBUTE::new(CKA_SENSITIVE).with_bool(&CK_TRUE));
628628
}
629629

630630
if usage_flags.copy {

0 commit comments

Comments
 (0)