RSASSAPSS Signing sha256 crash in EVP_MD_CTX_free(md_ctx); #21734
-
Updating to OpenSSL 3 . I am getting crash in
If i skip freeing the object then it works fine, also no error are dumped by ERR_print_errors_fp not sure why this is failing. Complete code used for signing is below:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Do not call Also there is no need to check whether a pointer is NULL before calling any free function in OpenSSL. All of them check for that internally. |
Beta Was this translation helpful? Give feedback.
Do not call
EVP_PKEY_CTX_new(pkey, NULL)
andEVP_PKEY_CTX_free(pkey_ctx)
. Your EVP_PKEY_CTX is getting overwritten by a pkey context stored inside the md context and then you introduce doublefree by calling both EVP_PKEY_CTX_free() and EVP_MD_CTX_free().Also there is no need to check whether a pointer is NULL before calling any free function in OpenSSL. All of them check for that internally.