Skip to content

Commit

Permalink
pkcs11-tool.c - fixup
Browse files Browse the repository at this point in the history
 On branch X25519-improvements-2
 Changes to be committed:
	modified:   tools/pkcs11-tool.c
  • Loading branch information
dengert committed Aug 31, 2024
1 parent 12b03e9 commit 5b7b087
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/tools/pkcs11-tool.c
Original file line number Diff line number Diff line change
Expand Up @@ -4447,8 +4447,7 @@ static CK_RV write_object(CK_SESSION_HANDLE session)
}

/* get CK_TYPE from EVP_PKEY if both supported by OpenSSL and PKCS11 */
rv = evp_pkey2ck_key_type(evp_key, &type, &pk_type);
if (rv != CKR_OK)
if (evp_pkey2ck_key_type(evp_key, &type, &pk_type) != CKR_OK)
util_fatal("Key type not supported by OpenSSL and/or PKCS11");

if (type == CKK_RSA) {
Expand Down Expand Up @@ -4569,8 +4568,7 @@ static CK_RV write_object(CK_SESSION_HANDLE session)
n_privkey_attr++;
}

rv = evp_pkey2ck_key_type(evp_key, &type, &pk_type);
if (rv != CKR_OK)
if (evp_pkey2ck_key_type(evp_key, &type, &pk_type) != CKR_OK)
util_fatal("Key type not supported by OpenSSL and/or PKCS11");

if (type == CKK_RSA) {
Expand Down Expand Up @@ -4622,8 +4620,7 @@ static CK_RV write_object(CK_SESSION_HANDLE session)
clazz = CKO_PUBLIC_KEY;

#ifdef ENABLE_OPENSSL
rv = evp_pkey2ck_key_type(evp_key, &type, &pk_type);
if (rv != CKR_OK)
if (evp_pkey2ck_key_type(evp_key, &type, &pk_type) != CKR_OK)
util_fatal("Key type not supported by OpenSSL and/or PKCS11");


Expand Down Expand Up @@ -4680,7 +4677,7 @@ static CK_RV write_object(CK_SESSION_HANDLE session)
n_pubkey_attr++;
}
#if !defined(OPENSSL_NO_EC)
else if ((type == CKK_EC) || (type == CKK_EC_EDWARDS) || CKK_EC_MONTGOMERY) {
else if ((type == CKK_EC) || (type == CKK_EC_EDWARDS) || (type == CKK_EC_MONTGOMERY)) {

FILL_ATTR(pubkey_templ[n_pubkey_attr], CKA_KEY_TYPE, &type, sizeof(type));
n_pubkey_attr++;
Expand Down

0 comments on commit 5b7b087

Please sign in to comment.