]>
Commit | Line | Data |
---|---|---|
aa6bb135 | 1 | /* |
677963e5 | 2 | * Copyright 1995-2017 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 | |
b50e1bd3 RL |
28 | #ifdef __cplusplus |
29 | extern "C" { | |
30 | #endif | |
31 | ||
67dc995e MC |
32 | #ifdef NDEBUG |
33 | # define ossl_assert(x) ((x) != 0) | |
34 | #else | |
35 | __owur static ossl_inline int ossl_assert_int(int expr, const char *exprstr, | |
36 | const char *file, int line) | |
37 | { | |
38 | if (!expr) | |
39 | OPENSSL_die(exprstr, file, line); | |
40 | ||
41 | return expr; | |
42 | } | |
43 | ||
44 | # define ossl_assert(x) ossl_assert_int((x) != 0, "Assertion failed: "#x, \ | |
45 | __FILE__, __LINE__) | |
46 | ||
47 | #endif | |
48 | ||
4a1f3f27 DSH |
49 | typedef struct ex_callback_st EX_CALLBACK; |
50 | ||
51 | DEFINE_STACK_OF(EX_CALLBACK) | |
52 | ||
e6b5c341 | 53 | typedef struct app_mem_info_st APP_INFO; |
76dc3563 | 54 | |
e6b5c341 | 55 | typedef struct mem_st MEM; |
89d6aa10 | 56 | DEFINE_LHASH_OF(MEM); |
4a1f3f27 | 57 | |
198c42f5 P |
58 | # define OPENSSL_CONF "openssl.cnf" |
59 | ||
0f113f3e MC |
60 | # ifndef OPENSSL_SYS_VMS |
61 | # define X509_CERT_AREA OPENSSLDIR | |
62 | # define X509_CERT_DIR OPENSSLDIR "/certs" | |
63 | # define X509_CERT_FILE OPENSSLDIR "/cert.pem" | |
64 | # define X509_PRIVATE_DIR OPENSSLDIR "/private" | |
98d8ddd2 | 65 | # define CTLOG_FILE OPENSSLDIR "/ct_log_list.cnf" |
0f113f3e | 66 | # else |
d17d3293 | 67 | # define X509_CERT_AREA "OSSL$DATAROOT:[000000]" |
a90f8d76 RL |
68 | # define X509_CERT_DIR "OSSL$DATAROOT:[CERTS]" |
69 | # define X509_CERT_FILE "OSSL$DATAROOT:[000000]cert.pem" | |
70 | # define X509_PRIVATE_DIR "OSSL$DATAROOT:[PRIVATE]" | |
71 | # define CTLOG_FILE "OSSL$DATAROOT:[000000]ct_log_list.cnf" | |
0f113f3e | 72 | # endif |
d02b48c6 | 73 | |
0f113f3e MC |
74 | # define X509_CERT_DIR_EVP "SSL_CERT_DIR" |
75 | # define X509_CERT_FILE_EVP "SSL_CERT_FILE" | |
8c6afbc5 | 76 | # define CTLOG_FILE_EVP "CTLOG_FILE" |
d02b48c6 | 77 | |
54a656ef | 78 | /* size of string representations */ |
0f113f3e MC |
79 | # define DECIMAL_SIZE(type) ((sizeof(type)*8+2)/3+1) |
80 | # define HEX_SIZE(type) (sizeof(type)*2) | |
54a656ef | 81 | |
2b247cf8 | 82 | void OPENSSL_cpuid_setup(void); |
e303f55f | 83 | extern unsigned int OPENSSL_ia32cap_P[]; |
0f113f3e | 84 | void OPENSSL_showfatal(const char *fmta, ...); |
51d28013 | 85 | extern int OPENSSL_NONPIC_relocated; |
b3599dbb | 86 | void crypto_cleanup_all_ex_data_int(void); |
2915fe19 | 87 | int openssl_init_fork_handlers(void); |
2b247cf8 | 88 | |
7d37818d | 89 | int openssl_strerror_r(int errnum, char *buf, size_t buflen); |
09487816 AP |
90 | # if !defined(OPENSSL_NO_STDIO) |
91 | FILE *openssl_fopen(const char *filename, const char *mode); | |
92 | # else | |
93 | void *openssl_fopen(const char *filename, const char *mode); | |
94 | # endif | |
7d37818d | 95 | |
d02b48c6 RE |
96 | #ifdef __cplusplus |
97 | } | |
98 | #endif | |
99 | ||
100 | #endif |