1 /* $NetBSD: dst_openssl.h,v 1.6 2024/02/21 22:52:06 christos Exp $ */ 2 3 /* 4 * Copyright (C) Internet Systems Consortium, Inc. ("ISC") 5 * 6 * SPDX-License-Identifier: MPL-2.0 7 * 8 * This Source Code Form is subject to the terms of the Mozilla Public 9 * License, v. 2.0. If a copy of the MPL was not distributed with this 10 * file, you can obtain one at https://mozilla.org/MPL/2.0/. 11 * 12 * See the COPYRIGHT file distributed with this work for additional 13 * information regarding copyright ownership. 14 */ 15 16 #pragma once 17 18 #include <openssl/bn.h> 19 #include <openssl/conf.h> 20 #include <openssl/crypto.h> 21 #include <openssl/err.h> 22 #include <openssl/evp.h> 23 #include <openssl/rand.h> 24 25 #include <isc/lang.h> 26 #include <isc/log.h> 27 #include <isc/result.h> 28 29 #if !HAVE_BN_GENCB_NEW 30 /* 31 * These are new in OpenSSL 1.1.0. BN_GENCB _cb needs to be declared in 32 * the function like this before the BN_GENCB_new call: 33 * 34 * #if !HAVE_BN_GENCB_NEW 35 * _cb; 36 * #endif 37 */ 38 #define BN_GENCB_free(x) ((void)0) 39 #define BN_GENCB_new() (&_cb) 40 #define BN_GENCB_get_arg(x) ((x)->arg) 41 #endif /* !HAVE_BN_GENCB_NEW */ 42 43 #if OPENSSL_VERSION_NUMBER >= 0x10100000L 44 /* 45 * EVP_dss1() is a version of EVP_sha1() that was needed prior to 46 * 1.1.0 because there was a link between digests and signing algorithms; 47 * the link has been eliminated and EVP_sha1() can be used now instead. 48 */ 49 #define EVP_dss1 EVP_sha1 50 #endif /* if OPENSSL_VERSION_NUMBER >= 0x10100000L */ 51 52 ISC_LANG_BEGINDECLS 53 54 isc_result_t 55 dst__openssl_toresult(isc_result_t fallback); 56 57 isc_result_t 58 dst__openssl_toresult2(const char *funcname, isc_result_t fallback); 59 60 isc_result_t 61 dst__openssl_toresult3(isc_logcategory_t *category, const char *funcname, 62 isc_result_t fallback); 63 64 #if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 65 ENGINE * 66 dst__openssl_getengine(const char *engine); 67 #endif /* if !defined(OPENSSL_NO_ENGINE) && OPENSSL_API_LEVEL < 30000 */ 68 69 ISC_LANG_ENDDECLS 70