summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/crypto.h
diff options
context:
space:
mode:
authorbeck <>2018-03-17 16:20:01 +0000
committerbeck <>2018-03-17 16:20:01 +0000
commitd18ae25f28e72831dc3c51f78e0735342540098b (patch)
tree12cc674e7652f4d67e57ec9e1882e6e824b4808d /src/lib/libcrypto/crypto.h
parent736fdc7bedf7fe8b17717032f7380c5c6e247d0d (diff)
downloadopenbsd-d18ae25f28e72831dc3c51f78e0735342540098b.tar.gz
openbsd-d18ae25f28e72831dc3c51f78e0735342540098b.tar.bz2
openbsd-d18ae25f28e72831dc3c51f78e0735342540098b.zip
Bring in compatibility for OpenSSL 1.1 style init functions.
This adds OPENSSL_init_crypto and OPENSSL_init_ssl, as well thread safety modifications for the existing LibreSSL init functions. The initialization routines are called automatically by the normal entry points into the library, as in newer OpenSSL ok jsing@, nits by tb@ and deraadt@
Diffstat (limited to 'src/lib/libcrypto/crypto.h')
-rw-r--r--src/lib/libcrypto/crypto.h36
1 files changed, 35 insertions, 1 deletions
diff --git a/src/lib/libcrypto/crypto.h b/src/lib/libcrypto/crypto.h
index 90c2875349..0eb29610b4 100644
--- a/src/lib/libcrypto/crypto.h
+++ b/src/lib/libcrypto/crypto.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto.h,v 1.42 2018/02/14 16:32:06 jsing Exp $ */ 1/* $OpenBSD: crypto.h,v 1.43 2018/03/17 16:20:01 beck Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -542,6 +542,40 @@ void ERR_load_CRYPTO_strings(void);
542#define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101 542#define CRYPTO_R_FIPS_MODE_NOT_SUPPORTED 101
543#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100 543#define CRYPTO_R_NO_DYNLOCK_CREATE_CALLBACK 100
544 544
545/*
546 * OpenSSL compatible OPENSSL_INIT options.
547 */
548
549#define OPENSSL_INIT_NO_LOAD_CONFIG 0x00000001L
550
551/* LibreSSL specific */
552#define _OPENSSL_INIT_FLAG_NOOP 0x80000000L
553
554/*
555 * These are provided for compatibiliy, but have no effect
556 * on how LibreSSL is initialized.
557 */
558#define OPENSSL_INIT__LOAD_CONFIG _OPENSSL_INIT_FLAG_NOOP
559#define OPENSSL_INIT_NO_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP
560#define OPENSSL_INIT_LOAD_CRYPTO_STRINGS _OPENSSL_INIT_FLAG_NOOP
561#define OPENSSL_INIT_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP
562#define OPENSSL_INIT_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP
563#define OPENSSL_INIT_NO_ADD_ALL_CIPHERS _OPENSSL_INIT_FLAG_NOOP
564#define OPENSSL_INIT_NO_ADD_ALL_DIGESTS _OPENSSL_INIT_FLAG_NOOP
565#define OPENSSL_INIT_ASYNC _OPENSSL_INIT_FLAG_NOOP
566#define OPENSSL_INIT_ENGINE_RDRAND _OPENSSL_INIT_FLAG_NOOP
567#define OPENSSL_INIT_ENGINE_DYNAMIC _OPENSSL_INIT_FLAG_NOOP
568#define OPENSSL_INIT_ENGINE_OPENSSL _OPENSSL_INIT_FLAG_NOOP
569#define OPENSSL_INIT_ENGINE_CRYPTODEV _OPENSSL_INIT_FLAG_NOOP
570#define OPENSSL_INIT_ENGINE_CAPI _OPENSSL_INIT_FLAG_NOOP
571#define OPENSSL_INIT_ENGINE_PADLOCK _OPENSSL_INIT_FLAG_NOOP
572#define OPENSSL_INIT_ENGINE_AFALG _OPENSSL_INIT_FLAG_NOOP
573#define OPENSSL_INIT_reserved_internal _OPENSSL_INIT_FLAG_NOOP
574#define OPENSSL_INIT_ATFORK _OPENSSL_INIT_FLAG_NOOP
575#define OPENSSL_INIT_ENGINE_ALL_BUILTIN _OPENSSL_INIT_FLAG_NOOP
576
577int OPENSSL_init_crypto(uint64_t opts, const void *settings);
578
545#ifdef __cplusplus 579#ifdef __cplusplus
546} 580}
547#endif 581#endif