From f1a4164b5544ad0c7c5eb1938cce7ed2af702bab Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Tue, 23 Jan 2018 09:25:37 -0500 Subject: [PATCH] Change key type when getting CKA_EC_PARAMS --- library/pkcs11_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/pkcs11_client.c b/library/pkcs11_client.c index 79d6648fd..a3e387a9a 100644 --- a/library/pkcs11_client.c +++ b/library/pkcs11_client.c @@ -271,7 +271,7 @@ int mbedtls_pk_setup_pkcs11( mbedtls_pk_context *ctx, attributes[0].type = CKA_MODULUS_BITS; attributes[0].pValue = &modulus_bits; attributes[0].ulValueLen = sizeof( modulus_bits ); - rv = C_GetAttributeValue( hSession, hPrivateKey, attributes, 1 ); + rv = C_GetAttributeValue( hSession, hPublicKey, attributes, 1 ); if( rv != CKR_OK ) return( pkcs11_err_to_mbedtls_pk_err( rv ) ); if( modulus_bits > (uint16_t)( -1 ) )