xref: /netbsd-src/external/mpl/bind/dist/lib/isc/openssl_shim.h (revision d90047b5d07facf36e6c01dcc0bded8997ce9cc2)
1 /*	$NetBSD: openssl_shim.h,v 1.3 2020/05/24 19:46:26 christos Exp $	*/
2 
3 /*
4  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9  *
10  * See the COPYRIGHT file distributed with this work for additional
11  * information regarding copyright ownership.
12  */
13 
14 #pragma once
15 
16 #include <openssl/crypto.h>
17 #include <openssl/engine.h>
18 #include <openssl/evp.h>
19 #include <openssl/hmac.h>
20 #include <openssl/opensslv.h>
21 
22 #if !HAVE_CRYPTO_ZALLOC
23 void *
24 CRYPTO_zalloc(size_t size);
25 #define OPENSSL_zalloc(num) CRYPTO_zalloc(num)
26 #endif /* if !HAVE_CRYPTO_ZALLOC */
27 
28 #if !HAVE_EVP_CIPHER_CTX_NEW
29 EVP_CIPHER_CTX *
30 EVP_CIPHER_CTX_new(void);
31 #endif /* if !HAVE_EVP_CIPHER_CTX_NEW */
32 
33 #if !HAVE_EVP_CIPHER_CTX_FREE
34 void
35 EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx);
36 #endif /* if !HAVE_EVP_CIPHER_CTX_FREE */
37 
38 #if !HAVE_EVP_MD_CTX_NEW
39 EVP_MD_CTX *
40 EVP_MD_CTX_new(void);
41 #endif /* if !HAVE_EVP_MD_CTX_NEW */
42 
43 #if !HAVE_EVP_MD_CTX_FREE
44 void
45 EVP_MD_CTX_free(EVP_MD_CTX *ctx);
46 #endif /* if !HAVE_EVP_MD_CTX_FREE */
47 
48 #if !HAVE_EVP_MD_CTX_RESET
49 int
50 EVP_MD_CTX_reset(EVP_MD_CTX *ctx);
51 #endif /* if !HAVE_EVP_MD_CTX_RESET */
52 
53 #if !HAVE_HMAC_CTX_NEW
54 HMAC_CTX *
55 HMAC_CTX_new(void);
56 #endif /* if !HAVE_HMAC_CTX_NEW */
57 
58 #if !HAVE_HMAC_CTX_FREE
59 void
60 HMAC_CTX_free(HMAC_CTX *ctx);
61 #endif /* if !HAVE_HMAC_CTX_FREE */
62 
63 #if !HAVE_HMAC_CTX_RESET
64 int
65 HMAC_CTX_reset(HMAC_CTX *ctx);
66 #endif /* if !HAVE_HMAC_CTX_RESET */
67 
68 #if !HAVE_HMAC_CTX_GET_MD
69 const EVP_MD *
70 HMAC_CTX_get_md(const HMAC_CTX *ctx);
71 #endif /* if !HAVE_HMAC_CTX_GET_MD */
72