diff options
Diffstat (limited to 'src/lib/libssl/src/apps/apps.h')
| -rw-r--r-- | src/lib/libssl/src/apps/apps.h | 91 |
1 files changed, 42 insertions, 49 deletions
diff --git a/src/lib/libssl/src/apps/apps.h b/src/lib/libssl/src/apps/apps.h index 88579094b1..596a39aceb 100644 --- a/src/lib/libssl/src/apps/apps.h +++ b/src/lib/libssl/src/apps/apps.h | |||
| @@ -137,11 +137,6 @@ long app_RAND_load_files(char *file); /* `file' is a list of files to read, | |||
| 137 | * (see e_os.h). The string is | 137 | * (see e_os.h). The string is |
| 138 | * destroyed! */ | 138 | * destroyed! */ |
| 139 | 139 | ||
| 140 | #ifdef OPENSSL_SYS_WIN32 | ||
| 141 | #define rename(from,to) WIN32_rename((from),(to)) | ||
| 142 | int WIN32_rename(const char *oldname,const char *newname); | ||
| 143 | #endif | ||
| 144 | |||
| 145 | #ifndef MONOLITH | 140 | #ifndef MONOLITH |
| 146 | 141 | ||
| 147 | #define MAIN(a,v) main(a,v) | 142 | #define MAIN(a,v) main(a,v) |
| @@ -149,11 +144,9 @@ int WIN32_rename(const char *oldname,const char *newname); | |||
| 149 | #ifndef NON_MAIN | 144 | #ifndef NON_MAIN |
| 150 | CONF *config=NULL; | 145 | CONF *config=NULL; |
| 151 | BIO *bio_err=NULL; | 146 | BIO *bio_err=NULL; |
| 152 | int in_FIPS_mode=0; | ||
| 153 | #else | 147 | #else |
| 154 | extern CONF *config; | 148 | extern CONF *config; |
| 155 | extern BIO *bio_err; | 149 | extern BIO *bio_err; |
| 156 | extern int in_FIPS_mode; | ||
| 157 | #endif | 150 | #endif |
| 158 | 151 | ||
| 159 | #else | 152 | #else |
| @@ -162,7 +155,6 @@ extern int in_FIPS_mode; | |||
| 162 | extern CONF *config; | 155 | extern CONF *config; |
| 163 | extern char *default_config_file; | 156 | extern char *default_config_file; |
| 164 | extern BIO *bio_err; | 157 | extern BIO *bio_err; |
| 165 | extern int in_FIPS_mode; | ||
| 166 | 158 | ||
| 167 | #endif | 159 | #endif |
| 168 | 160 | ||
| @@ -176,61 +168,37 @@ extern int in_FIPS_mode; | |||
| 176 | #define do_pipe_sig() | 168 | #define do_pipe_sig() |
| 177 | #endif | 169 | #endif |
| 178 | 170 | ||
| 171 | #ifdef OPENSSL_NO_COMP | ||
| 172 | #define zlib_cleanup() | ||
| 173 | #else | ||
| 174 | #define zlib_cleanup() COMP_zlib_cleanup() | ||
| 175 | #endif | ||
| 176 | |||
| 179 | #if defined(MONOLITH) && !defined(OPENSSL_C) | 177 | #if defined(MONOLITH) && !defined(OPENSSL_C) |
| 180 | # define apps_startup() \ | 178 | # define apps_startup() \ |
| 181 | do_pipe_sig() | 179 | do_pipe_sig() |
| 182 | # define apps_shutdown() | 180 | # define apps_shutdown() |
| 183 | #else | 181 | #else |
| 184 | # ifndef OPENSSL_NO_ENGINE | 182 | # ifndef OPENSSL_NO_ENGINE |
| 185 | # if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \ | 183 | # define apps_startup() \ |
| 186 | defined(OPENSSL_SYS_WIN32) | 184 | do { do_pipe_sig(); CRYPTO_malloc_init(); \ |
| 187 | # ifdef _O_BINARY | ||
| 188 | # define apps_startup() \ | ||
| 189 | do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ | ||
| 190 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ | ||
| 191 | ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) | ||
| 192 | # else | ||
| 193 | # define apps_startup() \ | ||
| 194 | do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ | ||
| 195 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ | 185 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ |
| 196 | ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) | 186 | ENGINE_load_builtin_engines(); setup_ui_method(); } while(0) |
| 197 | # endif | ||
| 198 | # else | ||
| 199 | # define apps_startup() \ | ||
| 200 | do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \ | ||
| 201 | ERR_load_crypto_strings(); ENGINE_load_builtin_engines(); \ | ||
| 202 | setup_ui_method(); } while(0) | ||
| 203 | # endif | ||
| 204 | # define apps_shutdown() \ | 187 | # define apps_shutdown() \ |
| 205 | do { CONF_modules_unload(1); destroy_ui_method(); \ | 188 | do { CONF_modules_unload(1); destroy_ui_method(); \ |
| 206 | EVP_cleanup(); ENGINE_cleanup(); \ | 189 | OBJ_cleanup(); EVP_cleanup(); ENGINE_cleanup(); \ |
| 207 | CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \ | 190 | CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ |
| 208 | ERR_free_strings(); } while(0) | 191 | ERR_free_strings(); zlib_cleanup();} while(0) |
| 209 | # else | 192 | # else |
| 210 | # if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WIN16) || \ | 193 | # define apps_startup() \ |
| 211 | defined(OPENSSL_SYS_WIN32) | 194 | do { do_pipe_sig(); CRYPTO_malloc_init(); \ |
| 212 | # ifdef _O_BINARY | ||
| 213 | # define apps_startup() \ | ||
| 214 | do { _fmode=_O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ | ||
| 215 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ | 195 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ |
| 216 | setup_ui_method(); } while(0) | 196 | setup_ui_method(); } while(0) |
| 217 | # else | ||
| 218 | # define apps_startup() \ | ||
| 219 | do { _fmode=O_BINARY; do_pipe_sig(); CRYPTO_malloc_init(); \ | ||
| 220 | ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); \ | ||
| 221 | setup_ui_method(); } while(0) | ||
| 222 | # endif | ||
| 223 | # else | ||
| 224 | # define apps_startup() \ | ||
| 225 | do { do_pipe_sig(); OpenSSL_add_all_algorithms(); \ | ||
| 226 | ERR_load_crypto_strings(); \ | ||
| 227 | setup_ui_method(); } while(0) | ||
| 228 | # endif | ||
| 229 | # define apps_shutdown() \ | 197 | # define apps_shutdown() \ |
| 230 | do { CONF_modules_unload(1); destroy_ui_method(); \ | 198 | do { CONF_modules_unload(1); destroy_ui_method(); \ |
| 231 | EVP_cleanup(); \ | 199 | OBJ_cleanup(); EVP_cleanup(); \ |
| 232 | CRYPTO_cleanup_all_ex_data(); ERR_remove_state(0); \ | 200 | CRYPTO_cleanup_all_ex_data(); ERR_remove_thread_state(NULL); \ |
| 233 | ERR_free_strings(); } while(0) | 201 | ERR_free_strings(); zlib_cleanup(); } while(0) |
| 234 | # endif | 202 | # endif |
| 235 | #endif | 203 | #endif |
| 236 | 204 | ||
| @@ -240,6 +208,7 @@ extern int in_FIPS_mode; | |||
| 240 | # define openssl_fdset(a,b) FD_SET(a, b) | 208 | # define openssl_fdset(a,b) FD_SET(a, b) |
| 241 | #endif | 209 | #endif |
| 242 | 210 | ||
| 211 | |||
| 243 | typedef struct args_st | 212 | typedef struct args_st |
| 244 | { | 213 | { |
| 245 | char **data; | 214 | char **data; |
| @@ -282,6 +251,8 @@ EVP_PKEY *load_pubkey(BIO *err, const char *file, int format, int maybe_stdin, | |||
| 282 | const char *pass, ENGINE *e, const char *key_descrip); | 251 | const char *pass, ENGINE *e, const char *key_descrip); |
| 283 | STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, | 252 | STACK_OF(X509) *load_certs(BIO *err, const char *file, int format, |
| 284 | const char *pass, ENGINE *e, const char *cert_descrip); | 253 | const char *pass, ENGINE *e, const char *cert_descrip); |
| 254 | STACK_OF(X509_CRL) *load_crls(BIO *err, const char *file, int format, | ||
| 255 | const char *pass, ENGINE *e, const char *cert_descrip); | ||
| 285 | X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); | 256 | X509_STORE *setup_verify(BIO *bp, char *CAfile, char *CApath); |
| 286 | #ifndef OPENSSL_NO_ENGINE | 257 | #ifndef OPENSSL_NO_ENGINE |
| 287 | ENGINE *setup_engine(BIO *err, const char *engine, int debug); | 258 | ENGINE *setup_engine(BIO *err, const char *engine, int debug); |
| @@ -290,6 +261,7 @@ ENGINE *setup_engine(BIO *err, const char *engine, int debug); | |||
| 290 | #ifndef OPENSSL_NO_OCSP | 261 | #ifndef OPENSSL_NO_OCSP |
| 291 | OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, | 262 | OCSP_RESPONSE *process_responder(BIO *err, OCSP_REQUEST *req, |
| 292 | char *host, char *path, char *port, int use_ssl, | 263 | char *host, char *path, char *port, int use_ssl, |
| 264 | STACK_OF(CONF_VALUE) *headers, | ||
| 293 | int req_timeout); | 265 | int req_timeout); |
| 294 | #endif | 266 | #endif |
| 295 | 267 | ||
| @@ -331,13 +303,23 @@ int index_index(CA_DB *db); | |||
| 331 | int save_index(const char *dbfile, const char *suffix, CA_DB *db); | 303 | int save_index(const char *dbfile, const char *suffix, CA_DB *db); |
| 332 | int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix); | 304 | int rotate_index(const char *dbfile, const char *new_suffix, const char *old_suffix); |
| 333 | void free_index(CA_DB *db); | 305 | void free_index(CA_DB *db); |
| 334 | int index_name_cmp(const char **a, const char **b); | 306 | #define index_name_cmp_noconst(a, b) \ |
| 307 | index_name_cmp((const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, a), \ | ||
| 308 | (const OPENSSL_CSTRING *)CHECKED_PTR_OF(OPENSSL_STRING, b)) | ||
| 309 | int index_name_cmp(const OPENSSL_CSTRING *a, const OPENSSL_CSTRING *b); | ||
| 335 | int parse_yesno(const char *str, int def); | 310 | int parse_yesno(const char *str, int def); |
| 336 | 311 | ||
| 337 | X509_NAME *parse_name(char *str, long chtype, int multirdn); | 312 | X509_NAME *parse_name(char *str, long chtype, int multirdn); |
| 338 | int args_verify(char ***pargs, int *pargc, | 313 | int args_verify(char ***pargs, int *pargc, |
| 339 | int *badarg, BIO *err, X509_VERIFY_PARAM **pm); | 314 | int *badarg, BIO *err, X509_VERIFY_PARAM **pm); |
| 340 | void policies_print(BIO *out, X509_STORE_CTX *ctx); | 315 | void policies_print(BIO *out, X509_STORE_CTX *ctx); |
| 316 | int bio_to_mem(unsigned char **out, int maxlen, BIO *in); | ||
| 317 | int pkey_ctrl_string(EVP_PKEY_CTX *ctx, char *value); | ||
| 318 | int init_gen_str(BIO *err, EVP_PKEY_CTX **pctx, | ||
| 319 | const char *algname, ENGINE *e, int do_param); | ||
| 320 | #ifndef OPENSSL_NO_PSK | ||
| 321 | extern char *psk_key; | ||
| 322 | #endif | ||
| 341 | #ifndef OPENSSL_NO_JPAKE | 323 | #ifndef OPENSSL_NO_JPAKE |
| 342 | void jpake_client_auth(BIO *out, BIO *conn, const char *secret); | 324 | void jpake_client_auth(BIO *out, BIO *conn, const char *secret); |
| 343 | void jpake_server_auth(BIO *out, BIO *conn, const char *secret); | 325 | void jpake_server_auth(BIO *out, BIO *conn, const char *secret); |
| @@ -353,6 +335,10 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret); | |||
| 353 | #define FORMAT_ENGINE 7 | 335 | #define FORMAT_ENGINE 7 |
| 354 | #define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid | 336 | #define FORMAT_IISSGC 8 /* XXX this stupid macro helps us to avoid |
| 355 | * adding yet another param to load_*key() */ | 337 | * adding yet another param to load_*key() */ |
| 338 | #define FORMAT_PEMRSA 9 /* PEM RSAPubicKey format */ | ||
| 339 | #define FORMAT_ASN1RSA 10 /* DER RSAPubicKey format */ | ||
| 340 | #define FORMAT_MSBLOB 11 /* MS Key blob format */ | ||
| 341 | #define FORMAT_PVK 12 /* MS PVK file format */ | ||
| 356 | 342 | ||
| 357 | #define EXT_COPY_NONE 0 | 343 | #define EXT_COPY_NONE 0 |
| 358 | #define EXT_COPY_ADD 1 | 344 | #define EXT_COPY_ADD 1 |
| @@ -364,4 +350,11 @@ void jpake_server_auth(BIO *out, BIO *conn, const char *secret); | |||
| 364 | 350 | ||
| 365 | #define SERIAL_RAND_BITS 64 | 351 | #define SERIAL_RAND_BITS 64 |
| 366 | 352 | ||
| 353 | int app_isdir(const char *); | ||
| 354 | int raw_read_stdin(void *,int); | ||
| 355 | int raw_write_stdout(const void *,int); | ||
| 356 | |||
| 357 | #define TM_START 0 | ||
| 358 | #define TM_STOP 1 | ||
| 359 | double app_tminterval (int stop,int usertime); | ||
| 367 | #endif | 360 | #endif |
