]>
Commit | Line | Data |
---|---|---|
aa6bb135 | 1 | /* |
360fc9f4 | 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. |
d02b48c6 | 3 | * |
aa6bb135 RS |
4 | * Licensed under the OpenSSL license (the "License"). You may not use |
5 | * this file except in compliance with the License. You can obtain a copy | |
6 | * in the file LICENSE in the source distribution or at | |
7 | * https://www.openssl.org/source/license.html | |
d02b48c6 RE |
8 | */ |
9 | ||
10 | #ifndef HEADER_CRYPTLIB_H | |
0f113f3e | 11 | # define HEADER_CRYPTLIB_H |
d02b48c6 | 12 | |
0f113f3e MC |
13 | # include <stdlib.h> |
14 | # include <string.h> | |
d02b48c6 | 15 | |
0f113f3e | 16 | # ifdef OPENSSL_USE_APPLINK |
b1b1cba4 | 17 | # undef BIO_FLAGS_UPLINK |
0f113f3e MC |
18 | # define BIO_FLAGS_UPLINK 0x8000 |
19 | # include "ms/uplink.h" | |
20 | # endif | |
ea1b02db | 21 | |
0f113f3e MC |
22 | # include <openssl/crypto.h> |
23 | # include <openssl/buffer.h> | |
24 | # include <openssl/bio.h> | |
25 | # include <openssl/err.h> | |
677963e5 | 26 | # include "internal/nelem.h" |
d02b48c6 | 27 | |
67dc995e MC |
28 | #ifdef NDEBUG |
29 | # define ossl_assert(x) ((x) != 0) | |
30 | #else | |
31 | __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr, | |
32 | const char *file, int line) | |
33 | { | |
34 | if (!expr) | |
35 | OPENSSL_die(exprstr, file, line); | |
36 | ||
37 | return expr; | |
38 | } | |
39 | ||
40 | # define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \ | |
41 | __FILE__, __LINE__) | |
42 | ||
43 | #endif | |
44 | ||
4a1f3f27 DSH |
45 | typedef struct ex_callback_st EX_CALLBACK; |
46 | ||
47 | DEFINE_STACK_OF(EX_CALLBACK) | |
48 | ||
e6b5c341 | 49 | typedef struct app_mem_info_st APP_INFO; |
76dc3563 | 50 | |
e6b5c341 | 51 | typedef struct mem_st MEM; |
89d6aa10 | 52 | DEFINE_LHASH_OF(MEM); |
4a1f3f27 | 53 | |
198c42f5 P |
54 | # define OPENSSL_CONF "openssl.cnf" |
55 | ||
0f113f3e MC |
56 | # ifndef OPENSSL_SYS_VMS |
57 | # define X509_CERT_AREA OPENSSLDIR | |
58 | # define X509_CERT_DIR OPENSSLDIR "/certs" | |
59 | # define X509_CERT_FILE OPENSSLDIR "/cert.pem" | |
60 | # define X509_PRIVATE_DIR OPENSSLDIR "/private" | |
98d8ddd2 | 61 | # define CTLOG_FILE OPENSSLDIR "/ct_log_list.cnf" |
0f113f3e | 62 | # else |
d17d3293 | 63 | # define X509_CERT_AREA "OSSL$DATAROOT:[000000]" |
a90f8d76 RL |
64 | # define X509_CERT_DIR "OSSL$DATAROOT:[CERTS]" |
65 | # define X509_CERT_FILE "OSSL$DATAROOT:[000000]cert.pem" | |
66 | # define X509_PRIVATE_DIR "OSSL$DATAROOT:[PRIVATE]" | |
67 | # define CTLOG_FILE "OSSL$DATAROOT:[000000]ct_log_list.cnf" | |
0f113f3e | 68 | # endif |
d02b48c6 | 69 | |
0f113f3e MC |
70 | # define X509_CERT_DIR_EVP "SSL_CERT_DIR" |
71 | # define X509_CERT_FILE_EVP "SSL_CERT_FILE" | |
8c6afbc5 | 72 | # define CTLOG_FILE_EVP "CTLOG_FILE" |
d02b48c6 | 73 | |
54a656ef | 74 | /* size of string representations */ |
0f113f3e MC |
75 | # define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) |
76 | # define HEX_SIZE(type) (sizeof(type)*2) | |
54a656ef | 77 | |
2b247cf8 | 78 | void OPENSSL_cpuid_setup(void); |
e303f55f | 79 | extern unsigned int OPENSSL_ia32cap_P[]; |
0f113f3e | 80 | void OPENSSL_showfatal(const char *fmta, ...); |
b3599dbb | 81 | void crypto_cleanup_all_ex_data_int(void); |
2915fe19 | 82 | int openssl_init_fork_handlers(void); |
2b247cf8 | 83 | |
0e598a3d | 84 | extern CRYPTO_RWLOCK *memdbg_lock; |
7d37818d | 85 | int openssl_strerror_r(int errnum, char *buf, size_t buflen); |
09487816 AP |
86 | # if !defined(OPENSSL_NO_STDIO) |
87 | FILE *openssl_fopen(const char *filename, const char *mode); | |
88 | # else | |
89 | void *openssl_fopen(const char *filename, const char *mode); | |
90 | # endif | |
7d37818d | 91 | |
360fc9f4 | 92 | uint32_t OPENSSL_rdtsc(void); |
d807db26 | 93 | |
d02b48c6 | 94 | #endif |