mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 08:05:21 +00:00
Use thinner shims for OpenSSL's EVP_MD_CTX_new() and EVP_MD_CTX_free()
The EVP_MD_CTX_new() and EVP_MD_CTX_free() functions are renamed APIs which were previously available as EVP_MD_CTX_create() and EVP_MD_CTX_destroy() respectively, which means that we can use them instead of providing our own shim functions.
This commit is contained in:
@@ -51,27 +51,6 @@ EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) {
|
|||||||
}
|
}
|
||||||
#endif /* if !HAVE_EVP_CIPHER_CTX_FREE */
|
#endif /* if !HAVE_EVP_CIPHER_CTX_FREE */
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_NEW
|
|
||||||
EVP_MD_CTX *
|
|
||||||
EVP_MD_CTX_new(void) {
|
|
||||||
EVP_MD_CTX *ctx = OPENSSL_malloc(sizeof(*ctx));
|
|
||||||
if (ctx != NULL) {
|
|
||||||
memset(ctx, 0, sizeof(*ctx));
|
|
||||||
}
|
|
||||||
return (ctx);
|
|
||||||
}
|
|
||||||
#endif /* if !HAVE_EVP_MD_CTX_NEW */
|
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_FREE
|
|
||||||
void
|
|
||||||
EVP_MD_CTX_free(EVP_MD_CTX *ctx) {
|
|
||||||
if (ctx != NULL) {
|
|
||||||
EVP_MD_CTX_cleanup(ctx);
|
|
||||||
OPENSSL_free(ctx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* if !HAVE_EVP_MD_CTX_FREE */
|
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_RESET
|
#if !HAVE_EVP_MD_CTX_RESET
|
||||||
int
|
int
|
||||||
EVP_MD_CTX_reset(EVP_MD_CTX *ctx) {
|
EVP_MD_CTX_reset(EVP_MD_CTX *ctx) {
|
||||||
|
@@ -38,13 +38,11 @@ EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx);
|
|||||||
#endif /* if !HAVE_EVP_CIPHER_CTX_FREE */
|
#endif /* if !HAVE_EVP_CIPHER_CTX_FREE */
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_NEW
|
#if !HAVE_EVP_MD_CTX_NEW
|
||||||
EVP_MD_CTX *
|
#define EVP_MD_CTX_new EVP_MD_CTX_create
|
||||||
EVP_MD_CTX_new(void);
|
|
||||||
#endif /* if !HAVE_EVP_MD_CTX_NEW */
|
#endif /* if !HAVE_EVP_MD_CTX_NEW */
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_FREE
|
#if !HAVE_EVP_MD_CTX_FREE
|
||||||
void
|
#define EVP_MD_CTX_free EVP_MD_CTX_destroy
|
||||||
EVP_MD_CTX_free(EVP_MD_CTX *ctx);
|
|
||||||
#endif /* if !HAVE_EVP_MD_CTX_FREE */
|
#endif /* if !HAVE_EVP_MD_CTX_FREE */
|
||||||
|
|
||||||
#if !HAVE_EVP_MD_CTX_RESET
|
#if !HAVE_EVP_MD_CTX_RESET
|
||||||
|
Reference in New Issue
Block a user