Stop leaking OpenSSL types and defines in the isc/md.h

The <isc/md.h> header directly included <openssl/evp.h> header which
enforced all users of the libisc library to explicitly list the include
path to OpenSSL and link with -lcrypto.  By hiding the specific
implementation into the private namespace, we no longer enforce this.
In the long run, this might also allow us to switch cryptographic
library implementation without affecting the downstream users.

While making the isc_md_type_t type opaque, the API using the data type
was changed to use the pointer to isc_md_type_t instead of using the
type directly.

(cherry picked from commit 4e114f8ed6)
This commit is contained in:
Ondřej Surý
2020-03-12 10:20:37 +01:00
parent d4b002cac7
commit c22c8cb0e1
10 changed files with 81 additions and 45 deletions

View File

@@ -84,7 +84,7 @@ isc_hmac_free_test(void **state) {
static void
isc_hmac_test(isc_hmac_t *hmac, const void *key, size_t keylen,
isc_md_type_t type, const char *buf, size_t buflen,
const isc_md_type_t *type, const char *buf, size_t buflen,
const char *result, const int repeats) {
assert_non_null(hmac);
assert_int_equal(isc_hmac_init(hmac, key, keylen, type), ISC_R_SUCCESS);