Skip to content

RSASSAPSS Signing sha256 crash in EVP_MD_CTX_free(md_ctx); #21734

Answered by t8m
aniljadaun asked this question in Q&A
Discussion options

You must be logged in to vote

Do not call EVP_PKEY_CTX_new(pkey, NULL) and EVP_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.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@aniljadaun
Comment options

@aniljadaun
Comment options

Answer selected by t8m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants