2014-07-14 23:28:14 +01:00
|
|
|
/* ====================================================================
|
|
|
|
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
*
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in
|
|
|
|
* the documentation and/or other materials provided with the
|
|
|
|
* distribution.
|
|
|
|
*
|
|
|
|
* 3. All advertising materials mentioning features or use of this
|
|
|
|
* software must display the following acknowledgment:
|
|
|
|
* "This product includes software developed by the OpenSSL Project
|
|
|
|
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
|
|
|
*
|
|
|
|
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
|
|
|
* endorse or promote products derived from this software without
|
|
|
|
* prior written permission. For written permission, please contact
|
|
|
|
* openssl-core@openssl.org.
|
|
|
|
*
|
|
|
|
* 5. Products derived from this software may not be called "OpenSSL"
|
|
|
|
* nor may "OpenSSL" appear in their names without prior written
|
|
|
|
* permission of the OpenSSL Project.
|
|
|
|
*
|
|
|
|
* 6. Redistributions of any form whatsoever must retain the following
|
|
|
|
* acknowledgment:
|
|
|
|
* "This product includes software developed by the OpenSSL Project
|
|
|
|
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
|
|
|
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
|
|
|
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
|
|
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
|
|
|
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
|
|
|
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
* ====================================================================
|
|
|
|
*
|
|
|
|
* This product includes cryptographic software written by Eric Young
|
|
|
|
* (eay@cryptsoft.com). This product includes software written by Tim
|
|
|
|
* Hudson (tjh@cryptsoft.com). */
|
|
|
|
|
|
|
|
#ifndef OPENSSL_HEADER_BASE_H
|
|
|
|
#define OPENSSL_HEADER_BASE_H
|
|
|
|
|
2014-07-31 00:02:14 +01:00
|
|
|
|
|
|
|
/* This file should be the first included by all BoringSSL headers. */
|
|
|
|
|
2015-03-28 07:12:01 +00:00
|
|
|
#include <stddef.h>
|
2014-07-14 23:28:14 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2016-02-25 16:39:59 +00:00
|
|
|
#include <openssl/opensslconf.h>
|
2014-07-15 03:21:44 +01:00
|
|
|
|
2016-04-14 21:35:26 +01:00
|
|
|
#if defined(BORINGSSL_PREFIX)
|
|
|
|
#include <boringssl_prefix_symbols.h>
|
|
|
|
#endif
|
|
|
|
|
2014-09-02 22:28:49 +01:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2014-07-14 23:28:14 +01:00
|
|
|
#if defined(__x86_64) || defined(_M_AMD64) || defined(_M_X64)
|
|
|
|
#define OPENSSL_64_BIT
|
|
|
|
#define OPENSSL_X86_64
|
|
|
|
#elif defined(__x86) || defined(__i386) || defined(__i386__) || defined(_M_IX86)
|
|
|
|
#define OPENSSL_32_BIT
|
|
|
|
#define OPENSSL_X86
|
|
|
|
#elif defined(__aarch64__)
|
|
|
|
#define OPENSSL_64_BIT
|
|
|
|
#define OPENSSL_AARCH64
|
|
|
|
#elif defined(__arm) || defined(__arm__) || defined(_M_ARM)
|
|
|
|
#define OPENSSL_32_BIT
|
|
|
|
#define OPENSSL_ARM
|
2015-06-16 01:15:46 +01:00
|
|
|
#elif defined(__PPC64__) || defined(__powerpc64__)
|
2015-01-09 23:44:37 +00:00
|
|
|
#define OPENSSL_64_BIT
|
2015-03-20 23:46:23 +00:00
|
|
|
#elif defined(__mips__) && !defined(__LP64__)
|
2014-07-14 23:28:14 +01:00
|
|
|
#define OPENSSL_32_BIT
|
|
|
|
#define OPENSSL_MIPS
|
2015-03-20 23:46:23 +00:00
|
|
|
#elif defined(__mips__) && defined(__LP64__)
|
|
|
|
#define OPENSSL_64_BIT
|
|
|
|
#define OPENSSL_MIPS64
|
2014-07-14 23:28:14 +01:00
|
|
|
#elif defined(__pnacl__)
|
|
|
|
#define OPENSSL_32_BIT
|
|
|
|
#define OPENSSL_PNACL
|
2016-07-21 23:46:57 +01:00
|
|
|
#elif defined(__myriad2__)
|
|
|
|
#define OPENSSL_32_BIT
|
2014-07-14 23:28:14 +01:00
|
|
|
#else
|
|
|
|
#error "Unknown target CPU"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__APPLE__)
|
|
|
|
#define OPENSSL_APPLE
|
|
|
|
#endif
|
|
|
|
|
2015-07-31 21:11:31 +01:00
|
|
|
#if defined(_WIN32)
|
2014-07-31 00:02:14 +01:00
|
|
|
#define OPENSSL_WINDOWS
|
|
|
|
#endif
|
|
|
|
|
2015-05-08 02:28:27 +01:00
|
|
|
#if defined(TRUSTY)
|
|
|
|
#define OPENSSL_TRUSTY
|
|
|
|
#define OPENSSL_NO_THREADS
|
|
|
|
#endif
|
|
|
|
|
2014-07-14 23:28:14 +01:00
|
|
|
#define OPENSSL_IS_BORINGSSL
|
2015-11-19 23:03:32 +00:00
|
|
|
#define BORINGSSL_201512
|
2016-03-11 19:39:46 +00:00
|
|
|
#define BORINGSSL_201603
|
2014-07-14 23:28:14 +01:00
|
|
|
#define OPENSSL_VERSION_NUMBER 0x10002000
|
2015-07-31 23:57:07 +01:00
|
|
|
#define SSLEAY_VERSION_NUMBER OPENSSL_VERSION_NUMBER
|
2014-07-14 23:28:14 +01:00
|
|
|
|
2016-05-05 23:54:33 +01:00
|
|
|
/* BORINGSSL_API_VERSION is a positive integer that increments as BoringSSL
|
|
|
|
* changes over time. The value itself is not meaningful. It will be incremented
|
|
|
|
* whenever is convenient to coordinate an API change with consumers. This will
|
|
|
|
* not denote any special point in development.
|
|
|
|
*
|
|
|
|
* A consumer may use this symbol in the preprocessor to temporarily build
|
|
|
|
* against multiple revisions of BoringSSL at the same time. It is not
|
|
|
|
* recommended to do so for longer than is necessary. */
|
2016-07-14 19:52:41 +01:00
|
|
|
#define BORINGSSL_API_VERSION 2
|
2016-05-05 23:54:33 +01:00
|
|
|
|
2014-07-31 00:02:14 +01:00
|
|
|
#if defined(BORINGSSL_SHARED_LIBRARY)
|
2014-07-14 23:28:14 +01:00
|
|
|
|
2014-07-31 00:02:14 +01:00
|
|
|
#if defined(OPENSSL_WINDOWS)
|
|
|
|
|
|
|
|
#if defined(BORINGSSL_IMPLEMENTATION)
|
|
|
|
#define OPENSSL_EXPORT __declspec(dllexport)
|
|
|
|
#else
|
|
|
|
#define OPENSSL_EXPORT __declspec(dllimport)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#else /* defined(OPENSSL_WINDOWS) */
|
|
|
|
|
|
|
|
#if defined(BORINGSSL_IMPLEMENTATION)
|
|
|
|
#define OPENSSL_EXPORT __attribute__((visibility("default")))
|
|
|
|
#else
|
|
|
|
#define OPENSSL_EXPORT
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* defined(OPENSSL_WINDOWS) */
|
|
|
|
|
|
|
|
#else /* defined(BORINGSSL_SHARED_LIBRARY) */
|
|
|
|
|
|
|
|
#define OPENSSL_EXPORT
|
|
|
|
|
|
|
|
#endif /* defined(BORINGSSL_SHARED_LIBRARY) */
|
2014-07-14 23:28:14 +01:00
|
|
|
|
2016-01-17 19:30:42 +00:00
|
|
|
|
|
|
|
#if defined(__GNUC__)
|
|
|
|
#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check) \
|
2016-03-30 05:42:17 +01:00
|
|
|
__attribute__((__format__(__printf__, string_index, first_to_check)))
|
2016-01-17 19:30:42 +00:00
|
|
|
#else
|
|
|
|
#define OPENSSL_PRINTF_FORMAT_FUNC(string_index, first_to_check)
|
|
|
|
#endif
|
|
|
|
|
2016-06-09 21:48:33 +01:00
|
|
|
/* OPENSSL_MSVC_PRAGMA emits a pragma on MSVC and nothing on other compilers. */
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
#define OPENSSL_MSVC_PRAGMA(arg) __pragma(arg)
|
|
|
|
#else
|
|
|
|
#define OPENSSL_MSVC_PRAGMA(arg)
|
|
|
|
#endif
|
|
|
|
|
2016-01-17 19:30:42 +00:00
|
|
|
|
2015-04-20 16:32:12 +01:00
|
|
|
/* CRYPTO_THREADID is a dummy value. */
|
|
|
|
typedef int CRYPTO_THREADID;
|
|
|
|
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef int ASN1_BOOLEAN;
|
|
|
|
typedef int ASN1_NULL;
|
|
|
|
typedef struct ASN1_ITEM_st ASN1_ITEM;
|
|
|
|
typedef struct asn1_object_st ASN1_OBJECT;
|
|
|
|
typedef struct asn1_pctx_st ASN1_PCTX;
|
|
|
|
typedef struct asn1_string_st ASN1_BIT_STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_BMPSTRING;
|
|
|
|
typedef struct asn1_string_st ASN1_ENUMERATED;
|
|
|
|
typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
|
|
|
|
typedef struct asn1_string_st ASN1_GENERALSTRING;
|
|
|
|
typedef struct asn1_string_st ASN1_IA5STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_INTEGER;
|
|
|
|
typedef struct asn1_string_st ASN1_OCTET_STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_PRINTABLESTRING;
|
|
|
|
typedef struct asn1_string_st ASN1_STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_T61STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_TIME;
|
|
|
|
typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
|
|
|
|
typedef struct asn1_string_st ASN1_UTCTIME;
|
|
|
|
typedef struct asn1_string_st ASN1_UTF8STRING;
|
|
|
|
typedef struct asn1_string_st ASN1_VISIBLESTRING;
|
|
|
|
|
|
|
|
typedef struct AUTHORITY_KEYID_st AUTHORITY_KEYID;
|
2016-07-19 20:41:35 +01:00
|
|
|
typedef struct BASIC_CONSTRAINTS_st BASIC_CONSTRAINTS;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct DIST_POINT_st DIST_POINT;
|
2016-07-19 20:41:35 +01:00
|
|
|
typedef struct DSA_SIG_st DSA_SIG;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct ISSUING_DIST_POINT_st ISSUING_DIST_POINT;
|
|
|
|
typedef struct NAME_CONSTRAINTS_st NAME_CONSTRAINTS;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct Netscape_certificate_sequence NETSCAPE_CERT_SEQUENCE;
|
|
|
|
typedef struct Netscape_spkac_st NETSCAPE_SPKAC;
|
|
|
|
typedef struct Netscape_spki_st NETSCAPE_SPKI;
|
|
|
|
typedef struct PBE2PARAM_st PBE2PARAM;
|
|
|
|
typedef struct PBEPARAM_st PBEPARAM;
|
|
|
|
typedef struct PBKDF2PARAM_st PBKDF2PARAM;
|
2016-03-08 22:17:02 +00:00
|
|
|
typedef struct RIPEMD160state_st RIPEMD160_CTX;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct X509_POLICY_CACHE_st X509_POLICY_CACHE;
|
|
|
|
typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL;
|
|
|
|
typedef struct X509_POLICY_NODE_st X509_POLICY_NODE;
|
|
|
|
typedef struct X509_POLICY_TREE_st X509_POLICY_TREE;
|
2016-07-19 20:41:35 +01:00
|
|
|
typedef struct X509_VERIFY_PARAM_st X509_VERIFY_PARAM;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct X509_algor_st X509_ALGOR;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct X509_crl_info_st X509_CRL_INFO;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct X509_crl_st X509_CRL;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct X509_extension_st X509_EXTENSION;
|
|
|
|
typedef struct X509_info_st X509_INFO;
|
|
|
|
typedef struct X509_name_entry_st X509_NAME_ENTRY;
|
|
|
|
typedef struct X509_name_st X509_NAME;
|
|
|
|
typedef struct X509_objects_st X509_OBJECTS;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct X509_pubkey_st X509_PUBKEY;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct X509_req_info_st X509_REQ_INFO;
|
|
|
|
typedef struct X509_req_st X509_REQ;
|
|
|
|
typedef struct X509_sig_st X509_SIG;
|
|
|
|
typedef struct X509_val_st X509_VAL;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct bignum_ctx BN_CTX;
|
|
|
|
typedef struct bignum_st BIGNUM;
|
|
|
|
typedef struct bio_method_st BIO_METHOD;
|
|
|
|
typedef struct bio_st BIO;
|
|
|
|
typedef struct bn_gencb_st BN_GENCB;
|
|
|
|
typedef struct bn_mont_ctx_st BN_MONT_CTX;
|
|
|
|
typedef struct buf_mem_st BUF_MEM;
|
|
|
|
typedef struct cbb_st CBB;
|
|
|
|
typedef struct cbs_st CBS;
|
2015-05-06 00:36:32 +01:00
|
|
|
typedef struct cmac_ctx_st CMAC_CTX;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct conf_st CONF;
|
2015-03-28 07:12:01 +00:00
|
|
|
typedef struct conf_value_st CONF_VALUE;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct dh_st DH;
|
|
|
|
typedef struct dsa_st DSA;
|
2016-07-19 20:41:35 +01:00
|
|
|
typedef struct ec_group_st EC_GROUP;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct ec_key_st EC_KEY;
|
2016-07-19 20:41:35 +01:00
|
|
|
typedef struct ec_point_st EC_POINT;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct ecdsa_method_st ECDSA_METHOD;
|
|
|
|
typedef struct ecdsa_sig_st ECDSA_SIG;
|
|
|
|
typedef struct engine_st ENGINE;
|
|
|
|
typedef struct env_md_ctx_st EVP_MD_CTX;
|
|
|
|
typedef struct env_md_st EVP_MD;
|
|
|
|
typedef struct evp_aead_st EVP_AEAD;
|
|
|
|
typedef struct evp_cipher_ctx_st EVP_CIPHER_CTX;
|
|
|
|
typedef struct evp_cipher_st EVP_CIPHER;
|
2015-09-19 20:17:34 +01:00
|
|
|
typedef struct evp_encode_ctx_st EVP_ENCODE_CTX;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct evp_pkey_asn1_method_st EVP_PKEY_ASN1_METHOD;
|
|
|
|
typedef struct evp_pkey_ctx_st EVP_PKEY_CTX;
|
|
|
|
typedef struct evp_pkey_method_st EVP_PKEY_METHOD;
|
|
|
|
typedef struct evp_pkey_st EVP_PKEY;
|
|
|
|
typedef struct hmac_ctx_st HMAC_CTX;
|
2014-08-22 19:06:14 +01:00
|
|
|
typedef struct md4_state_st MD4_CTX;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct md5_state_st MD5_CTX;
|
2016-04-18 19:30:19 +01:00
|
|
|
typedef struct newhope_poly_st NEWHOPE_POLY;
|
2014-09-19 18:49:56 +01:00
|
|
|
typedef struct pkcs12_st PKCS12;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct pkcs8_priv_key_info_st PKCS8_PRIV_KEY_INFO;
|
|
|
|
typedef struct private_key_st X509_PKEY;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct rand_meth_st RAND_METHOD;
|
2015-02-20 23:32:52 +00:00
|
|
|
typedef struct rc4_key_st RC4_KEY;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct rsa_meth_st RSA_METHOD;
|
|
|
|
typedef struct rsa_st RSA;
|
|
|
|
typedef struct sha256_state_st SHA256_CTX;
|
|
|
|
typedef struct sha512_state_st SHA512_CTX;
|
|
|
|
typedef struct sha_state_st SHA_CTX;
|
2016-02-10 02:09:00 +00:00
|
|
|
typedef struct spake2_ctx_st SPAKE2_CTX;
|
2015-09-14 06:54:44 +01:00
|
|
|
typedef struct srtp_protection_profile_st SRTP_PROTECTION_PROFILE;
|
2015-09-13 18:53:19 +01:00
|
|
|
typedef struct ssl_cipher_st SSL_CIPHER;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct ssl_ctx_st SSL_CTX;
|
2015-07-31 02:10:13 +01:00
|
|
|
typedef struct ssl_custom_extension SSL_CUSTOM_EXTENSION;
|
2015-09-13 18:53:19 +01:00
|
|
|
typedef struct ssl_method_st SSL_METHOD;
|
2015-09-13 19:07:33 +01:00
|
|
|
typedef struct ssl_session_st SSL_SESSION;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct ssl_st SSL;
|
|
|
|
typedef struct st_ERR_FNS ERR_FNS;
|
|
|
|
typedef struct v3_ext_ctx X509V3_CTX;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct x509_attributes_st X509_ATTRIBUTE;
|
|
|
|
typedef struct x509_cert_aux_st X509_CERT_AUX;
|
|
|
|
typedef struct x509_cert_pair_st X509_CERT_PAIR;
|
|
|
|
typedef struct x509_cinf_st X509_CINF;
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef struct x509_crl_method_st X509_CRL_METHOD;
|
|
|
|
typedef struct x509_revoked_st X509_REVOKED;
|
|
|
|
typedef struct x509_st X509;
|
|
|
|
typedef struct x509_store_ctx_st X509_STORE_CTX;
|
|
|
|
typedef struct x509_store_st X509_STORE;
|
2015-08-03 22:14:14 +01:00
|
|
|
typedef struct x509_trust_st X509_TRUST;
|
|
|
|
|
2014-07-14 23:28:14 +01:00
|
|
|
typedef void *OPENSSL_BLOCK;
|
|
|
|
|
|
|
|
|
2014-09-02 22:28:49 +01:00
|
|
|
#if defined(__cplusplus)
|
|
|
|
} /* extern C */
|
|
|
|
#endif
|
|
|
|
|
2014-07-14 23:28:14 +01:00
|
|
|
#endif /* OPENSSL_HEADER_BASE_H */
|