| 1 |
// Copyright (c) 2022, Google Inc. |
| 2 |
// SPDX-License-Identifier: ISC |
| 3 |
// Modifications copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 4 |
// SPDX-License-Identifier: Apache-2.0 OR ISC |
| 5 |
|
| 6 |
#ifndef OPENSSL_HEADER_RUST_WRAPPER_H |
| 7 |
#define OPENSSL_HEADER_RUST_WRAPPER_H |
| 8 |
|
| 9 |
#include "openssl/is_awslc.h" |
| 10 |
#include "openssl/aes.h" |
| 11 |
#include "openssl/asn1.h" |
| 12 |
#include "openssl/asn1_mac.h" |
| 13 |
#include "openssl/asn1t.h" |
| 14 |
#include "openssl/base.h" |
| 15 |
#include "openssl/base64.h" |
| 16 |
#include "openssl/bio.h" |
| 17 |
#include "openssl/blake2.h" |
| 18 |
#include "openssl/blowfish.h" |
| 19 |
#include "openssl/bn.h" |
| 20 |
#include "openssl/buf.h" |
| 21 |
#include "openssl/buffer.h" |
| 22 |
#include "openssl/bytestring.h" |
| 23 |
#include "openssl/chacha.h" |
| 24 |
#include "openssl/cipher.h" |
| 25 |
#include "openssl/cmac.h" |
| 26 |
#include "openssl/conf.h" |
| 27 |
#include "openssl/cpu.h" |
| 28 |
#include "openssl/crypto.h" |
| 29 |
#include "openssl/ctrdrbg.h" |
| 30 |
#include "openssl/curve25519.h" |
| 31 |
#include "openssl/des.h" |
| 32 |
#include "openssl/dh.h" |
| 33 |
#include "openssl/digest.h" |
| 34 |
#include "openssl/dsa.h" |
| 35 |
#include "openssl/e_os2.h" |
| 36 |
#include "openssl/ec.h" |
| 37 |
#include "openssl/ec_key.h" |
| 38 |
#include "openssl/ecdh.h" |
| 39 |
#include "openssl/ecdsa.h" |
| 40 |
#include "openssl/engine.h" |
| 41 |
#include "openssl/err.h" |
| 42 |
#include "openssl/evp.h" |
| 43 |
#include "openssl/evp_errors.h" |
| 44 |
#include "openssl/ex_data.h" |
| 45 |
#include "openssl/hkdf.h" |
| 46 |
#include "openssl/hmac.h" |
| 47 |
#include "openssl/hpke.h" |
| 48 |
#include "openssl/hrss.h" |
| 49 |
#include "openssl/kdf.h" |
| 50 |
#include "openssl/lhash.h" |
| 51 |
#include "openssl/md4.h" |
| 52 |
#include "openssl/md5.h" |
| 53 |
#include "openssl/mem.h" |
| 54 |
#include "openssl/ocsp.h" |
| 55 |
#include "openssl/obj.h" |
| 56 |
#include "openssl/obj_mac.h" |
| 57 |
#include "openssl/objects.h" |
| 58 |
#include "openssl/opensslconf.h" |
| 59 |
#include "openssl/opensslv.h" |
| 60 |
#include "openssl/ossl_typ.h" |
| 61 |
#include "openssl/pem.h" |
| 62 |
#include "openssl/pkcs12.h" |
| 63 |
#include "openssl/pkcs7.h" |
| 64 |
#include "openssl/pkcs8.h" |
| 65 |
#include "openssl/poly1305.h" |
| 66 |
#include "openssl/pool.h" |
| 67 |
#include "openssl/rand.h" |
| 68 |
#include "openssl/rc4.h" |
| 69 |
#include "openssl/ripemd.h" |
| 70 |
#include "openssl/rsa.h" |
| 71 |
#include "openssl/safestack.h" |
| 72 |
#include "openssl/sha.h" |
| 73 |
#include "openssl/siphash.h" |
| 74 |
#include "openssl/span.h" |
| 75 |
#include "openssl/stack.h" |
| 76 |
#include "openssl/thread.h" |
| 77 |
#include "openssl/trust_token.h" |
| 78 |
#include "openssl/type_check.h" |
| 79 |
#include "openssl/x509.h" |
| 80 |
#include "openssl/x509_vfy.h" |
| 81 |
#include "openssl/x509v3.h" |
| 82 |
#include "openssl/experimental/kem_deterministic_api.h" |
| 83 |
|
| 84 |
#if defined(AWS_LC_RUST_INCLUDE_SSL) |
| 85 |
#include "openssl/ssl.h" |
| 86 |
#include "openssl/ssl3.h" |
| 87 |
#endif |
| 88 |
|
| 89 |
#ifdef _WIN32 |
| 90 |
#define AWS_LC_SYS_EXPORT __declspec(dllexport) |
| 91 |
#else |
| 92 |
#define AWS_LC_SYS_EXPORT __attribute__((visibility("default"))) |
| 93 |
#endif |
| 94 |
|
| 95 |
#define AWS_LC_WRAPPER_ADD_PREFIX(a, b) AWS_LC_WRAPPER_ADD_PREFIX_INNER(a, b) |
| 96 |
#define AWS_LC_WRAPPER_ADD_PREFIX_INNER(a, b) a ## _ ## b |
| 97 |
|
| 98 |
#if defined(BORINGSSL_PREFIX) |
| 99 |
#define ERR_GET_LIB_RUST AWS_LC_WRAPPER_ADD_PREFIX(BORINGSSL_PREFIX, ERR_GET_LIB_RUST) |
| 100 |
#define ERR_GET_REASON_RUST AWS_LC_WRAPPER_ADD_PREFIX(BORINGSSL_PREFIX, ERR_GET_REASON_RUST) |
| 101 |
#define ERR_GET_FUNC_RUST AWS_LC_WRAPPER_ADD_PREFIX(BORINGSSL_PREFIX, ERR_GET_FUNC_RUST) |
| 102 |
#endif // BORINGSSL_PREFIX |
| 103 |
|
| 104 |
#if defined(__cplusplus) |
| 105 |
extern "C" { |
| 106 |
#endif |
| 107 |
|
| 108 |
// The following functions are wrappers over inline functions and macros in |
| 109 |
// BoringSSL, which bindgen cannot currently correctly bind. These wrappers |
| 110 |
// ensure changes to the functions remain in lockstep with the Rust versions. |
| 111 |
AWS_LC_SYS_EXPORT int ERR_GET_LIB_RUST(uint32_t packed_error); |
| 112 |
AWS_LC_SYS_EXPORT int ERR_GET_REASON_RUST(uint32_t packed_error); |
| 113 |
AWS_LC_SYS_EXPORT int ERR_GET_FUNC_RUST(uint32_t packed_error); |
| 114 |
|
| 115 |
#if defined(__cplusplus) |
| 116 |
} // extern C |
| 117 |
#endif |
| 118 |
|
| 119 |
#endif // OPENSSL_HEADER_RUST_WRAPPER_H |