Require specifying openssl PKCS11 engine or provider access method
Mimi Zohar
maintainerPATCH 1/1 Require specifying openssl PKCS11 engine or provider access method
Directly calling the new imaevm_signhash() function without specifying the access_info may result in dereferencing a NULL pointer. Require specifying the openssl PKCS11 access method.
Fixes 5d89393ff9ab ("Implement imaevm_signhash library function and deprecate sign_hash")
Signed-off-by Mimi Zohar <[email protected]>
--- src/libimaevm.c | 5 +++++ 1 file changed, 5 insertions(+)
src/libimaevm.c +5 -0
@@ -1118,6 +1118,11 @@ static EVP_PKEY *read_priv_pkey(const char *keyfile, const char *keypass,EVP_PKEY *pkey =NULL ;if (!strncmp (keyfile,"pkcs11:" ,7 )) { +if (!access_info) { +log_err ("PKCS11 engine or provider not specified" ); +return NULL ; + } +switch (access_info->type) {case IMAEVM_OSSL_ACCESS_TYPE_ENGINE : pkey = read_priv_pkey_engine(access_info->u.engine,
Signature · 1 line
2.43.0
Quoted 6 lines · Mimi Zohar
Directly calling the new
imaevm_signhash()function without specifying theaccess_infomay result in dereferencing a NULL pointer. Require specifying the openssl PKCS11 access method.Fixes 5d89393ff9ab ("Implement imaevm_signhash library function and deprecate sign_hash")Signed-off-by Mimi Zohar <[email protected]>
Reviewed-by Stefan Berger <[email protected]>
Quoted 20 lines
--- src/libimaevm.c | 5 +++++ 1 file changed, 5 insertions(+)src/libimaevm.c +5
-0@@ -1118,6 +1118,11 @@ static EVP_PKEY *read_priv_pkey(const char *keyfile, const char *keypass,EVP_PKEY *pkey =NULL ;if (!strncmp (keyfile,"pkcs11:" ,7 )) { +if (!access_info) { +log_err ("PKCS11 engine or provider not specified" ); +return NULL ; + } +switch (access_info->type) {case IMAEVM_OSSL_ACCESS_TYPE_ENGINE : pkey = read_priv_pkey_engine(access_info->u.engine,