Merge pull request #2357 from a-dma/p11_extractable

pkcs11-tool: allow setting CKA_EXTRACTABLE during keypair generation
This commit is contained in:
Frank Morgner 2021-07-05 16:21:41 +02:00 committed by GitHub
commit d90048e5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -2745,6 +2745,12 @@ static int gen_keypair(CK_SLOT_ID slot, CK_SESSION_HANDLE session,
n_privkey_attr++;
}
if (opt_is_extractable != 0) {
FILL_ATTR(privateKeyTemplate[n_privkey_attr], CKA_EXTRACTABLE,
&_true, sizeof(_true));
n_privkey_attr++;
}
if (opt_allowed_mechanisms_len > 0) {
FILL_ATTR(privateKeyTemplate[n_privkey_attr],
CKA_ALLOWED_MECHANISMS, opt_allowed_mechanisms,