2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 22:45:39 +00:00

Merge branch '1672-stop-leaking-external-headers-and-symbols-to-the-public-api-isc/hmac.h' into 'master'

Make isc_hmac API to not leak OpenSSL symbols

See merge request isc-projects/bind9!3216
This commit is contained in:
Ondřej Surý
2020-03-12 21:22:46 +00:00
2 changed files with 4 additions and 8 deletions

View File

@@ -25,9 +25,9 @@
isc_hmac_t * isc_hmac_t *
isc_hmac_new(void) { isc_hmac_new(void) {
isc_hmac_t *hmac = HMAC_CTX_new(); HMAC_CTX *hmac = HMAC_CTX_new();
RUNTIME_CHECK(hmac != NULL); RUNTIME_CHECK(hmac != NULL);
return (hmac); return ((struct hmac *)hmac);
} }
void void
@@ -120,10 +120,8 @@ isc_result_t
isc_hmac(isc_md_type_t type, const void *key, const int keylen, isc_hmac(isc_md_type_t type, const void *key, const int keylen,
const unsigned char *buf, const size_t len, unsigned char *digest, const unsigned char *buf, const size_t len, unsigned char *digest,
unsigned int *digestlen) { unsigned int *digestlen) {
isc_hmac_t *hmac = NULL;
isc_result_t res; isc_result_t res;
isc_hmac_t *hmac = isc_hmac_new();
hmac = isc_hmac_new();
res = isc_hmac_init(hmac, key, keylen, type); res = isc_hmac_init(hmac, key, keylen, type);
if (res != ISC_R_SUCCESS) { if (res != ISC_R_SUCCESS) {

View File

@@ -22,9 +22,7 @@
#include <isc/result.h> #include <isc/result.h>
#include <isc/types.h> #include <isc/types.h>
#include <openssl/hmac.h> typedef void isc_hmac_t;
typedef HMAC_CTX isc_hmac_t;
/** /**
* isc_hmac: * isc_hmac: