diff --git a/lib/isc/openssl_shim.c b/lib/isc/openssl_shim.c index 70435c9c6e..ee98050f6d 100644 --- a/lib/isc/openssl_shim.c +++ b/lib/isc/openssl_shim.c @@ -11,8 +11,6 @@ #include -#if HAVE_OPENSSL - #include #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) @@ -24,22 +22,25 @@ #include #include -void *OPENSSL_zalloc(size_t size) +void * +OPENSSL_zalloc(size_t size) { void *ret = OPENSSL_malloc(size); if (ret != NULL) { memset(ret, 0, size); } - return ret; + return (ret); } -EVP_CIPHER_CTX* EVP_CIPHER_CTX_new(void) +EVP_CIPHER_CTX * +EVP_CIPHER_CTX_new(void) { EVP_CIPHER_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); - return ctx; + return (ctx); } -void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) +void +EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) { if (ctx != NULL) { EVP_CIPHER_CTX_cleanup(ctx); @@ -47,16 +48,18 @@ void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx) } } -EVP_MD_CTX *EVP_MD_CTX_new(void) +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; + return (ctx); } -void EVP_MD_CTX_free(EVP_MD_CTX *ctx) +void +EVP_MD_CTX_free(EVP_MD_CTX *ctx) { if (ctx != NULL) { EVP_MD_CTX_cleanup(ctx); @@ -64,24 +67,27 @@ void EVP_MD_CTX_free(EVP_MD_CTX *ctx) } } -int EVP_MD_CTX_reset(EVP_MD_CTX *ctx) +int +EVP_MD_CTX_reset(EVP_MD_CTX *ctx) { - return EVP_MD_CTX_cleanup(ctx); + return (EVP_MD_CTX_cleanup(ctx)); } -HMAC_CTX *HMAC_CTX_new(void) +HMAC_CTX * +HMAC_CTX_new(void) { HMAC_CTX *ctx = OPENSSL_zalloc(sizeof(*ctx)); if (ctx != NULL) { if (!HMAC_CTX_reset(ctx)) { HMAC_CTX_free(ctx); - return NULL; + return (NULL); } } - return ctx; + return (ctx); } -void HMAC_CTX_free(HMAC_CTX *ctx) +void +HMAC_CTX_free(HMAC_CTX *ctx) { if (ctx != NULL) { HMAC_CTX_cleanup(ctx); @@ -89,11 +95,11 @@ void HMAC_CTX_free(HMAC_CTX *ctx) } } -int HMAC_CTX_reset(HMAC_CTX *ctx) { +int +HMAC_CTX_reset(HMAC_CTX *ctx) { HMAC_CTX_cleanup(ctx); - return 1; + return (1); } -#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */ - -#endif /* HAVE_OPENSSL */ +#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L || + * defined(LIBRESSL_VERSION_NUMBER) */ diff --git a/lib/isc/openssl_shim.h b/lib/isc/openssl_shim.h index d6ff64a595..1a148b50c3 100644 --- a/lib/isc/openssl_shim.h +++ b/lib/isc/openssl_shim.h @@ -13,8 +13,6 @@ #include -#if HAVE_OPENSSL - #include #if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) @@ -23,7 +21,7 @@ #include void *OPENSSL_zalloc(size_t size); -EVP_CIPHER_CTX* EVP_CIPHER_CTX_new(void); +EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx); EVP_MD_CTX *EVP_MD_CTX_new(void); void EVP_MD_CTX_free(EVP_MD_CTX *ctx); @@ -32,6 +30,5 @@ HMAC_CTX *HMAC_CTX_new(void); void HMAC_CTX_free(HMAC_CTX *ctx); int HMAC_CTX_reset(HMAC_CTX *ctx); -#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */ - -#endif /* HAVE_OPENSSL */ +#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L || + * defined(LIBRESSL_VERSION_NUMBER) */