xref: /openbsd-src/usr.bin/dig/lib/dns/openssl_link.c (revision fb5a997b4fd2c4b3bd8dfb265decd49c6d9b165a)
15185a700Sflorian /*
25185a700Sflorian  * Portions Copyright (C) Internet Systems Consortium, Inc. ("ISC")
35185a700Sflorian  *
45185a700Sflorian  * Permission to use, copy, modify, and/or distribute this software for any
55185a700Sflorian  * purpose with or without fee is hereby granted, provided that the above
65185a700Sflorian  * copyright notice and this permission notice appear in all copies.
75185a700Sflorian  *
85185a700Sflorian  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
95185a700Sflorian  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
105185a700Sflorian  * WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE
115185a700Sflorian  * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
125185a700Sflorian  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
135185a700Sflorian  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
145185a700Sflorian  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
155185a700Sflorian  *
165185a700Sflorian  * See the COPYRIGHT file distributed with this work for additional
175185a700Sflorian  * information regarding copyright ownership.
185185a700Sflorian  *
195185a700Sflorian  * Portions Copyright (C) Network Associates, Inc.
205185a700Sflorian  *
215185a700Sflorian  * Permission to use, copy, modify, and/or distribute this software for any
225185a700Sflorian  * purpose with or without fee is hereby granted, provided that the above
235185a700Sflorian  * copyright notice and this permission notice appear in all copies.
245185a700Sflorian  *
255185a700Sflorian  * THE SOFTWARE IS PROVIDED "AS IS" AND ISC AND NETWORK ASSOCIATES DISCLAIMS
265185a700Sflorian  * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
275185a700Sflorian  * WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE
285185a700Sflorian  * FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
295185a700Sflorian  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
305185a700Sflorian  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
315185a700Sflorian  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
325185a700Sflorian  */
335185a700Sflorian 
345185a700Sflorian /*
355185a700Sflorian  * Principal Author: Brian Wellington
365185a700Sflorian  */
375185a700Sflorian 
38c6d1a7a6Sjsg #include <isc/result.h>
395185a700Sflorian 
40c6d1a7a6Sjsg #include <openssl/conf.h>
41c6d1a7a6Sjsg #include <openssl/crypto.h>
42c6d1a7a6Sjsg #include <openssl/err.h>
43c6d1a7a6Sjsg #include <openssl/evp.h>
44c6d1a7a6Sjsg #include <openssl/objects.h>
455185a700Sflorian 
465185a700Sflorian #include "dst_internal.h"
475185a700Sflorian 
485185a700Sflorian isc_result_t
dst__openssl_init(void)4959bd6e9fSflorian dst__openssl_init(void) {
505185a700Sflorian 	ERR_load_crypto_strings();
515185a700Sflorian 	return (ISC_R_SUCCESS);
525185a700Sflorian }
535185a700Sflorian 
545185a700Sflorian void
dst__openssl_destroy(void)555185a700Sflorian dst__openssl_destroy(void) {
565185a700Sflorian 	/*
575185a700Sflorian 	 * Sequence taken from apps_shutdown() in <apps/apps.h>.
585185a700Sflorian 	 */
595185a700Sflorian 	CONF_modules_free();
605185a700Sflorian 	OBJ_cleanup();
615185a700Sflorian 	EVP_cleanup();
625185a700Sflorian 	CRYPTO_cleanup_all_ex_data();
635185a700Sflorian 	ERR_clear_error();
64*fb5a997bStb 	ERR_remove_thread_state(NULL);
655185a700Sflorian 	ERR_free_strings();
665185a700Sflorian 
675185a700Sflorian }
685185a700Sflorian 
695185a700Sflorian /*! \file */
70