File indexing completed on 2025-01-18 10:05:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef OPENSSL_ENGINE_H
0012 # define OPENSSL_ENGINE_H
0013 # pragma once
0014
0015 # include <openssl/macros.h>
0016 # ifndef OPENSSL_NO_DEPRECATED_3_0
0017 # define HEADER_ENGINE_H
0018 # endif
0019
0020 # include <openssl/opensslconf.h>
0021
0022 # ifndef OPENSSL_NO_ENGINE
0023 # ifndef OPENSSL_NO_DEPRECATED_1_1_0
0024 # include <openssl/bn.h>
0025 # include <openssl/rsa.h>
0026 # include <openssl/dsa.h>
0027 # include <openssl/dh.h>
0028 # include <openssl/ec.h>
0029 # include <openssl/rand.h>
0030 # include <openssl/ui.h>
0031 # include <openssl/err.h>
0032 # endif
0033 # include <openssl/types.h>
0034 # include <openssl/symhacks.h>
0035 # include <openssl/x509.h>
0036 # include <openssl/engineerr.h>
0037 # ifdef __cplusplus
0038 extern "C" {
0039 # endif
0040
0041
0042
0043
0044
0045 # define ENGINE_METHOD_RSA (unsigned int)0x0001
0046 # define ENGINE_METHOD_DSA (unsigned int)0x0002
0047 # define ENGINE_METHOD_DH (unsigned int)0x0004
0048 # define ENGINE_METHOD_RAND (unsigned int)0x0008
0049 # define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
0050 # define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
0051 # define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
0052 # define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
0053 # define ENGINE_METHOD_EC (unsigned int)0x0800
0054
0055 # define ENGINE_METHOD_ALL (unsigned int)0xFFFF
0056 # define ENGINE_METHOD_NONE (unsigned int)0x0000
0057
0058
0059
0060
0061
0062
0063
0064 # define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
0065
0066
0067
0068
0069
0070
0071
0072
0073
0074
0075
0076 # define ENGINE_FLAGS_MANUAL_CMD_CTRL (int)0x0002
0077
0078
0079
0080
0081
0082
0083
0084
0085
0086
0087
0088 # define ENGINE_FLAGS_BY_ID_COPY (int)0x0004
0089
0090
0091
0092
0093
0094
0095
0096 # define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111 # define ENGINE_CMD_FLAG_NUMERIC (unsigned int)0x0001
0112
0113
0114
0115
0116 # define ENGINE_CMD_FLAG_STRING (unsigned int)0x0002
0117
0118
0119
0120
0121 # define ENGINE_CMD_FLAG_NO_INPUT (unsigned int)0x0004
0122
0123
0124
0125
0126
0127 # define ENGINE_CMD_FLAG_INTERNAL (unsigned int)0x0008
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146 # define ENGINE_CTRL_SET_LOGSTREAM 1
0147 # define ENGINE_CTRL_SET_PASSWORD_CALLBACK 2
0148 # define ENGINE_CTRL_HUP 3
0149
0150
0151 # define ENGINE_CTRL_SET_USER_INTERFACE 4
0152 # define ENGINE_CTRL_SET_CALLBACK_DATA 5
0153
0154
0155
0156 # define ENGINE_CTRL_LOAD_CONFIGURATION 6
0157
0158
0159
0160 # define ENGINE_CTRL_LOAD_SECTION 7
0161
0162
0163
0164
0165
0166
0167
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177
0178
0179
0180
0181
0182
0183
0184 # define ENGINE_CTRL_HAS_CTRL_FUNCTION 10
0185
0186
0187
0188
0189 # define ENGINE_CTRL_GET_FIRST_CMD_TYPE 11
0190
0191
0192
0193
0194 # define ENGINE_CTRL_GET_NEXT_CMD_TYPE 12
0195
0196
0197
0198
0199 # define ENGINE_CTRL_GET_CMD_FROM_NAME 13
0200
0201
0202
0203
0204
0205
0206
0207
0208 # define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD 14
0209 # define ENGINE_CTRL_GET_NAME_FROM_CMD 15
0210
0211 # define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD 16
0212 # define ENGINE_CTRL_GET_DESC_FROM_CMD 17
0213
0214
0215
0216
0217
0218 # define ENGINE_CTRL_GET_CMD_FLAGS 18
0219
0220
0221
0222
0223
0224 # define ENGINE_CMD_BASE 200
0225
0226
0227
0228
0229
0230
0231
0232
0233
0234
0235 # define ENGINE_CTRL_CHIL_SET_FORKCHECK 100
0236
0237
0238
0239
0240
0241 # define ENGINE_CTRL_CHIL_NO_LOCKING 101
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252
0253
0254
0255
0256
0257 typedef struct ENGINE_CMD_DEFN_st {
0258 unsigned int cmd_num;
0259 const char *cmd_name;
0260 const char *cmd_desc;
0261 unsigned int cmd_flags;
0262 } ENGINE_CMD_DEFN;
0263
0264
0265 typedef int (*ENGINE_GEN_FUNC_PTR) (void);
0266
0267 typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
0268
0269 typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
0270 void (*f) (void));
0271
0272 typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
0273 UI_METHOD *ui_method,
0274 void *callback_data);
0275 typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
0276 STACK_OF(X509_NAME) *ca_dn,
0277 X509 **pcert, EVP_PKEY **pkey,
0278 STACK_OF(X509) **pother,
0279 UI_METHOD *ui_method,
0280 void *callback_data);
0281
0282
0283
0284
0285
0286
0287
0288
0289
0290
0291
0292
0293
0294
0295
0296 typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
0297 const int **, int);
0298 typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
0299 int);
0300 typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
0301 const int **, int);
0302 typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
0303 const int **, int);
0304
0305
0306
0307
0308
0309
0310
0311
0312
0313
0314
0315
0316
0317 # ifndef OPENSSL_NO_DEPRECATED_3_0
0318 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_first(void);
0319 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_last(void);
0320 # endif
0321
0322 # ifndef OPENSSL_NO_DEPRECATED_3_0
0323 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_next(ENGINE *e);
0324 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_prev(ENGINE *e);
0325 # endif
0326
0327 # ifndef OPENSSL_NO_DEPRECATED_3_0
0328 OSSL_DEPRECATEDIN_3_0 int ENGINE_add(ENGINE *e);
0329 # endif
0330
0331 # ifndef OPENSSL_NO_DEPRECATED_3_0
0332 OSSL_DEPRECATEDIN_3_0 int ENGINE_remove(ENGINE *e);
0333 # endif
0334
0335 # ifndef OPENSSL_NO_DEPRECATED_3_0
0336 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_by_id(const char *id);
0337 # endif
0338
0339 # ifndef OPENSSL_NO_DEPRECATED_1_1_0
0340 # define ENGINE_load_openssl() \
0341 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
0342 # define ENGINE_load_dynamic() \
0343 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
0344 # ifndef OPENSSL_NO_STATIC_ENGINE
0345 # define ENGINE_load_padlock() \
0346 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
0347 # define ENGINE_load_capi() \
0348 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
0349 # define ENGINE_load_afalg() \
0350 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
0351 # endif
0352 # define ENGINE_load_cryptodev() \
0353 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
0354 # define ENGINE_load_rdrand() \
0355 OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
0356 # endif
0357 # ifndef OPENSSL_NO_DEPRECATED_3_0
0358 OSSL_DEPRECATEDIN_3_0 void ENGINE_load_builtin_engines(void);
0359 # endif
0360
0361
0362
0363
0364
0365 # ifndef OPENSSL_NO_DEPRECATED_3_0
0366 OSSL_DEPRECATEDIN_3_0 unsigned int ENGINE_get_table_flags(void);
0367 OSSL_DEPRECATEDIN_3_0 void ENGINE_set_table_flags(unsigned int flags);
0368 # endif
0369
0370
0371
0372
0373
0374
0375
0376
0377 # ifndef OPENSSL_NO_DEPRECATED_3_0
0378 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RSA(ENGINE *e);
0379 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RSA(ENGINE *e);
0380 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RSA(void);
0381 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DSA(ENGINE *e);
0382 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DSA(ENGINE *e);
0383 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DSA(void);
0384 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_EC(ENGINE *e);
0385 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_EC(ENGINE *e);
0386 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_EC(void);
0387 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_DH(ENGINE *e);
0388 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_DH(ENGINE *e);
0389 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_DH(void);
0390 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_RAND(ENGINE *e);
0391 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_RAND(ENGINE *e);
0392 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_RAND(void);
0393 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_ciphers(ENGINE *e);
0394 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_ciphers(ENGINE *e);
0395 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_ciphers(void);
0396 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_digests(ENGINE *e);
0397 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_digests(ENGINE *e);
0398 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_digests(void);
0399 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_meths(ENGINE *e);
0400 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_meths(ENGINE *e);
0401 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_meths(void);
0402 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
0403 OSSL_DEPRECATEDIN_3_0 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
0404 OSSL_DEPRECATEDIN_3_0 void ENGINE_register_all_pkey_asn1_meths(void);
0405 # endif
0406
0407
0408
0409
0410
0411
0412
0413 # ifndef OPENSSL_NO_DEPRECATED_3_0
0414 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_complete(ENGINE *e);
0415 OSSL_DEPRECATEDIN_3_0 int ENGINE_register_all_complete(void);
0416 # endif
0417
0418
0419
0420
0421
0422
0423
0424
0425
0426
0427
0428 # ifndef OPENSSL_NO_DEPRECATED_3_0
0429 OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p,
0430 void (*f) (void));
0431 # endif
0432
0433
0434
0435
0436
0437
0438
0439 # ifndef OPENSSL_NO_DEPRECATED_3_0
0440 OSSL_DEPRECATEDIN_3_0 int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
0441 # endif
0442
0443
0444
0445
0446
0447
0448
0449 # ifndef OPENSSL_NO_DEPRECATED_3_0
0450 OSSL_DEPRECATEDIN_3_0 int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
0451 long i, void *p, void (*f) (void),
0452 int cmd_optional);
0453 # endif
0454
0455
0456
0457
0458
0459
0460
0461
0462
0463
0464
0465
0466
0467
0468
0469
0470
0471
0472
0473
0474
0475
0476
0477 # ifndef OPENSSL_NO_DEPRECATED_3_0
0478 OSSL_DEPRECATEDIN_3_0
0479 int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
0480 int cmd_optional);
0481 # endif
0482
0483
0484
0485
0486
0487
0488
0489
0490
0491 # ifndef OPENSSL_NO_DEPRECATED_3_0
0492 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_new(void);
0493 OSSL_DEPRECATEDIN_3_0 int ENGINE_free(ENGINE *e);
0494 OSSL_DEPRECATEDIN_3_0 int ENGINE_up_ref(ENGINE *e);
0495 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_id(ENGINE *e, const char *id);
0496 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_name(ENGINE *e, const char *name);
0497 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
0498 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
0499 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
0500 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
0501 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
0502 OSSL_DEPRECATEDIN_3_0
0503 int ENGINE_set_destroy_function(ENGINE *e,ENGINE_GEN_INT_FUNC_PTR destroy_f);
0504 OSSL_DEPRECATEDIN_3_0
0505 int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
0506 OSSL_DEPRECATEDIN_3_0
0507 int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
0508 OSSL_DEPRECATEDIN_3_0
0509 int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
0510 OSSL_DEPRECATEDIN_3_0
0511 int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
0512 OSSL_DEPRECATEDIN_3_0
0513 int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
0514 OSSL_DEPRECATEDIN_3_0
0515 int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
0516 ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
0517 OSSL_DEPRECATEDIN_3_0
0518 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
0519 OSSL_DEPRECATEDIN_3_0
0520 int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
0521 OSSL_DEPRECATEDIN_3_0
0522 int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
0523 OSSL_DEPRECATEDIN_3_0
0524 int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
0525 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_flags(ENGINE *e, int flags);
0526 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_cmd_defns(ENGINE *e,
0527 const ENGINE_CMD_DEFN *defns);
0528 # endif
0529
0530 # define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
0531 CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
0532 # ifndef OPENSSL_NO_DEPRECATED_3_0
0533 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
0534 OSSL_DEPRECATEDIN_3_0 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
0535 # endif
0536
0537 # ifndef OPENSSL_NO_DEPRECATED_1_1_0
0538
0539
0540
0541
0542 # define ENGINE_cleanup() while(0) continue
0543 # endif
0544
0545
0546
0547
0548
0549
0550
0551 # ifndef OPENSSL_NO_DEPRECATED_3_0
0552 OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_id(const ENGINE *e);
0553 OSSL_DEPRECATEDIN_3_0 const char *ENGINE_get_name(const ENGINE *e);
0554 OSSL_DEPRECATEDIN_3_0 const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
0555 OSSL_DEPRECATEDIN_3_0 const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
0556 OSSL_DEPRECATEDIN_3_0 const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
0557 OSSL_DEPRECATEDIN_3_0 const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
0558 OSSL_DEPRECATEDIN_3_0 const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
0559 OSSL_DEPRECATEDIN_3_0
0560 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
0561 OSSL_DEPRECATEDIN_3_0
0562 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
0563 OSSL_DEPRECATEDIN_3_0
0564 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
0565 OSSL_DEPRECATEDIN_3_0
0566 ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
0567 OSSL_DEPRECATEDIN_3_0
0568 ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
0569 OSSL_DEPRECATEDIN_3_0
0570 ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
0571 OSSL_DEPRECATEDIN_3_0
0572 ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
0573 OSSL_DEPRECATEDIN_3_0
0574 ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
0575 OSSL_DEPRECATEDIN_3_0
0576 ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
0577 OSSL_DEPRECATEDIN_3_0
0578 ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
0579 OSSL_DEPRECATEDIN_3_0
0580 ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
0581 OSSL_DEPRECATEDIN_3_0
0582 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
0583 OSSL_DEPRECATEDIN_3_0
0584 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
0585 OSSL_DEPRECATEDIN_3_0
0586 const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
0587 OSSL_DEPRECATEDIN_3_0
0588 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
0589 OSSL_DEPRECATEDIN_3_0
0590 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
0591 const char *str,
0592 int len);
0593 OSSL_DEPRECATEDIN_3_0
0594 const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
0595 const char *str, int len);
0596 OSSL_DEPRECATEDIN_3_0
0597 const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
0598 OSSL_DEPRECATEDIN_3_0 int ENGINE_get_flags(const ENGINE *e);
0599 # endif
0600
0601
0602
0603
0604
0605
0606
0607
0608
0609
0610
0611
0612
0613
0614
0615
0616
0617
0618
0619 # ifndef OPENSSL_NO_DEPRECATED_3_0
0620 OSSL_DEPRECATEDIN_3_0 int ENGINE_init(ENGINE *e);
0621 # endif
0622
0623
0624
0625
0626
0627 # ifndef OPENSSL_NO_DEPRECATED_3_0
0628 OSSL_DEPRECATEDIN_3_0 int ENGINE_finish(ENGINE *e);
0629 # endif
0630
0631
0632
0633
0634
0635
0636 # ifndef OPENSSL_NO_DEPRECATED_3_0
0637 OSSL_DEPRECATEDIN_3_0
0638 EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
0639 UI_METHOD *ui_method, void *callback_data);
0640 OSSL_DEPRECATEDIN_3_0
0641 EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
0642 UI_METHOD *ui_method, void *callback_data);
0643 OSSL_DEPRECATEDIN_3_0
0644 int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s, STACK_OF(X509_NAME) *ca_dn,
0645 X509 **pcert, EVP_PKEY **ppkey,
0646 STACK_OF(X509) **pother,
0647 UI_METHOD *ui_method, void *callback_data);
0648 # endif
0649
0650
0651
0652
0653
0654
0655
0656 # ifndef OPENSSL_NO_DEPRECATED_3_0
0657 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RSA(void);
0658 # endif
0659
0660 # ifndef OPENSSL_NO_DEPRECATED_3_0
0661 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DSA(void);
0662 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_EC(void);
0663 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_DH(void);
0664 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_default_RAND(void);
0665 # endif
0666
0667
0668
0669
0670 # ifndef OPENSSL_NO_DEPRECATED_3_0
0671 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_cipher_engine(int nid);
0672 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_digest_engine(int nid);
0673 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
0674 OSSL_DEPRECATEDIN_3_0 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
0675 # endif
0676
0677
0678
0679
0680
0681
0682
0683 # ifndef OPENSSL_NO_DEPRECATED_3_0
0684 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RSA(ENGINE *e);
0685 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_string(ENGINE *e,
0686 const char *def_list);
0687 # endif
0688
0689 # ifndef OPENSSL_NO_DEPRECATED_3_0
0690 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DSA(ENGINE *e);
0691 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_EC(ENGINE *e);
0692 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_DH(ENGINE *e);
0693 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_RAND(ENGINE *e);
0694 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_ciphers(ENGINE *e);
0695 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_digests(ENGINE *e);
0696 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_meths(ENGINE *e);
0697 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
0698 # endif
0699
0700
0701
0702
0703
0704
0705
0706
0707 # ifndef OPENSSL_NO_DEPRECATED_3_0
0708 OSSL_DEPRECATEDIN_3_0 int ENGINE_set_default(ENGINE *e, unsigned int flags);
0709 OSSL_DEPRECATEDIN_3_0 void ENGINE_add_conf_module(void);
0710 # endif
0711
0712
0713
0714
0715
0716
0717
0718
0719
0720 # define OSSL_DYNAMIC_VERSION (unsigned long)0x00030000
0721
0722
0723
0724
0725 # define OSSL_DYNAMIC_OLDEST (unsigned long)0x00030000
0726
0727
0728
0729
0730
0731
0732
0733
0734
0735
0736
0737
0738 typedef void *(*dyn_MEM_malloc_fn) (size_t, const char *, int);
0739 typedef void *(*dyn_MEM_realloc_fn) (void *, size_t, const char *, int);
0740 typedef void (*dyn_MEM_free_fn) (void *, const char *, int);
0741 typedef struct st_dynamic_MEM_fns {
0742 dyn_MEM_malloc_fn malloc_fn;
0743 dyn_MEM_realloc_fn realloc_fn;
0744 dyn_MEM_free_fn free_fn;
0745 } dynamic_MEM_fns;
0746
0747
0748
0749
0750
0751 typedef struct st_dynamic_fns {
0752 void *static_state;
0753 dynamic_MEM_fns mem_fns;
0754 } dynamic_fns;
0755
0756
0757
0758
0759
0760
0761
0762
0763
0764
0765
0766
0767
0768 typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
0769 # define IMPLEMENT_DYNAMIC_CHECK_FN() \
0770 OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
0771 OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
0772 if (v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
0773 return 0; }
0774
0775
0776
0777
0778
0779
0780
0781
0782
0783
0784
0785
0786
0787
0788
0789
0790
0791
0792
0793 typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
0794 const dynamic_fns *fns);
0795 # define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
0796 OPENSSL_EXPORT \
0797 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
0798 OPENSSL_EXPORT \
0799 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
0800 if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
0801 CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \
0802 fns->mem_fns.realloc_fn, \
0803 fns->mem_fns.free_fn); \
0804 OPENSSL_init_crypto(OPENSSL_INIT_NO_ATEXIT, NULL); \
0805 skip_cbs: \
0806 if (!fn(e, id)) return 0; \
0807 return 1; }
0808
0809
0810
0811
0812
0813
0814
0815
0816
0817
0818
0819
0820 void *ENGINE_get_static_state(void);
0821
0822 # if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
0823 # ifndef OPENSSL_NO_DEPRECATED_1_1_0
0824 OSSL_DEPRECATEDIN_1_1_0 void ENGINE_setup_bsd_cryptodev(void);
0825 # endif
0826 # endif
0827
0828
0829 # ifdef __cplusplus
0830 }
0831 # endif
0832 # endif
0833 #endif