Skip to content

Commit 5280b33

Browse files
committed
pkcs11-tool: Do not set PARAMETER_SET on private key template during key generation
The attribute is defined in the list with the footnote 4 (from Table 13) with the description: > MUST not be specified when object is generated with C_GenerateKey This matches what EC_PARAMS have and how they are (correctly) handled. softhsm/SoftHSMv2#850 Signed-off-by: Jakub Jelen <jjelen@redhat.com>
1 parent 835c43c commit 5280b33

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

src/tools/pkcs11-tool.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3727,9 +3727,6 @@ static int gen_keypair(CK_SLOT_ID slot, CK_SESSION_HANDLE session,
37273727
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_PARAMETER_SET,
37283728
&ml_dsa_parameter_set, sizeof(CK_ML_DSA_PARAMETER_SET_TYPE));
37293729
n_pubkey_attr++;
3730-
FILL_ATTR(privateKeyTemplate[n_privkey_attr], CKA_PARAMETER_SET,
3731-
&ml_dsa_parameter_set, sizeof(CK_ML_DSA_PARAMETER_SET_TYPE));
3732-
n_privkey_attr++;
37333730

37343731
if (opt_key_usage_default || opt_key_usage_sign) {
37353732
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_VERIFY, &_true, sizeof(_true));
@@ -3761,9 +3758,6 @@ static int gen_keypair(CK_SLOT_ID slot, CK_SESSION_HANDLE session,
37613758
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_PARAMETER_SET,
37623759
&ml_kem_parameter_set, sizeof(CK_ML_KEM_PARAMETER_SET_TYPE));
37633760
n_pubkey_attr++;
3764-
FILL_ATTR(privateKeyTemplate[n_privkey_attr], CKA_PARAMETER_SET,
3765-
&ml_kem_parameter_set, sizeof(CK_ML_KEM_PARAMETER_SET_TYPE));
3766-
n_privkey_attr++;
37673761

37683762
if (opt_key_usage_default || opt_key_usage_encapsulate) {
37693763
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_ENCAPSULATE, &_true, sizeof(_true));
@@ -3813,9 +3807,6 @@ static int gen_keypair(CK_SLOT_ID slot, CK_SESSION_HANDLE session,
38133807
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_PARAMETER_SET,
38143808
&slh_dsa_parameter_set, sizeof(CK_SLH_DSA_PARAMETER_SET_TYPE));
38153809
n_pubkey_attr++;
3816-
FILL_ATTR(privateKeyTemplate[n_privkey_attr], CKA_PARAMETER_SET,
3817-
&slh_dsa_parameter_set, sizeof(CK_SLH_DSA_PARAMETER_SET_TYPE));
3818-
n_privkey_attr++;
38193810

38203811
if (opt_key_usage_default || opt_key_usage_sign) {
38213812
FILL_ATTR(publicKeyTemplate[n_pubkey_attr], CKA_VERIFY, &_true, sizeof(_true));

0 commit comments

Comments
 (0)