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.
This commit is contained in:
Ondřej Surý
2020-03-12 10:20:37 +01:00
parent 6052e254b9
commit 4e114f8ed6
10 changed files with 81 additions and 45 deletions

View File

@@ -82,8 +82,8 @@ isc_md_free_test(void **state) {
}
static void
isc_md_test(isc_md_t *md, isc_md_type_t type, const char *buf, size_t buflen,
const char *result, const int repeats) {
isc_md_test(isc_md_t *md, const isc_md_type_t *type, const char *buf,
size_t buflen, const char *result, const int repeats) {
assert_non_null(md);
assert_int_equal(isc_md_init(md, type), ISC_R_SUCCESS);