Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(181)

Side by Side Diff: openssl/crypto/engine/engine.h

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/crypto/engine/eng_table.c ('k') | openssl/crypto/engine/enginetest.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* openssl/engine.h */ 1 /* openssl/engine.h */
2 /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL 2 /* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
5 /* ==================================================================== 5 /* ====================================================================
6 * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved. 6 * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 #ifndef OPENSSL_NO_DH 81 #ifndef OPENSSL_NO_DH
82 #include <openssl/dh.h> 82 #include <openssl/dh.h>
83 #endif 83 #endif
84 #ifndef OPENSSL_NO_ECDH 84 #ifndef OPENSSL_NO_ECDH
85 #include <openssl/ecdh.h> 85 #include <openssl/ecdh.h>
86 #endif 86 #endif
87 #ifndef OPENSSL_NO_ECDSA 87 #ifndef OPENSSL_NO_ECDSA
88 #include <openssl/ecdsa.h> 88 #include <openssl/ecdsa.h>
89 #endif 89 #endif
90 #include <openssl/rand.h> 90 #include <openssl/rand.h>
91 #include <openssl/store.h>
92 #include <openssl/ui.h> 91 #include <openssl/ui.h>
93 #include <openssl/err.h> 92 #include <openssl/err.h>
94 #endif 93 #endif
95 94
96 #include <openssl/x509.h>
97
98 #include <openssl/ossl_typ.h> 95 #include <openssl/ossl_typ.h>
99 #include <openssl/symhacks.h> 96 #include <openssl/symhacks.h>
100 97
98 #include <openssl/x509.h>
99
101 #ifdef __cplusplus 100 #ifdef __cplusplus
102 extern "C" { 101 extern "C" {
103 #endif 102 #endif
104 103
105 /* These flags are used to control combinations of algorithm (methods) 104 /* These flags are used to control combinations of algorithm (methods)
106 * by bitwise "OR"ing. */ 105 * by bitwise "OR"ing. */
107 #define ENGINE_METHOD_RSA (unsigned int)0x0001 106 #define ENGINE_METHOD_RSA (unsigned int)0x0001
108 #define ENGINE_METHOD_DSA (unsigned int)0x0002 107 #define ENGINE_METHOD_DSA (unsigned int)0x0002
109 #define ENGINE_METHOD_DH (unsigned int)0x0004 108 #define ENGINE_METHOD_DH (unsigned int)0x0004
110 #define ENGINE_METHOD_RAND (unsigned int)0x0008 109 #define ENGINE_METHOD_RAND (unsigned int)0x0008
111 #define ENGINE_METHOD_ECDH (unsigned int)0x0010 110 #define ENGINE_METHOD_ECDH (unsigned int)0x0010
112 #define ENGINE_METHOD_ECDSA (unsigned int)0x0020 111 #define ENGINE_METHOD_ECDSA (unsigned int)0x0020
113 #define ENGINE_METHOD_CIPHERS (unsigned int)0x0040 112 #define ENGINE_METHOD_CIPHERS (unsigned int)0x0040
114 #define ENGINE_METHOD_DIGESTS (unsigned int)0x0080 113 #define ENGINE_METHOD_DIGESTS (unsigned int)0x0080
115 #define ENGINE_METHOD_STORE (unsigned int)0x0100 114 #define ENGINE_METHOD_STORE (unsigned int)0x0100
115 #define ENGINE_METHOD_PKEY_METHS (unsigned int)0x0200
116 #define ENGINE_METHOD_PKEY_ASN1_METHS (unsigned int)0x0400
116 /* Obvious all-or-nothing cases. */ 117 /* Obvious all-or-nothing cases. */
117 #define ENGINE_METHOD_ALL (unsigned int)0xFFFF 118 #define ENGINE_METHOD_ALL (unsigned int)0xFFFF
118 #define ENGINE_METHOD_NONE (unsigned int)0x0000 119 #define ENGINE_METHOD_NONE (unsigned int)0x0000
119 120
120 /* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used 121 /* This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
121 * internally to control registration of ENGINE implementations, and can be set 122 * internally to control registration of ENGINE implementations, and can be set
122 * by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to 123 * by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
123 * initialise registered ENGINEs if they are not already initialised. */ 124 * initialise registered ENGINEs if they are not already initialised. */
124 #define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001 125 #define ENGINE_TABLE_FLAG_NOINIT (unsigned int)0x0001
125 126
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 * Looking at how to implement these handlers in the case of cipher support, if 291 * Looking at how to implement these handlers in the case of cipher support, if
291 * the framework wants the EVP_CIPHER for 'nid', it will call; 292 * the framework wants the EVP_CIPHER for 'nid', it will call;
292 * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure) 293 * foo(e, &p_evp_cipher, NULL, nid); (return zero for failure)
293 * If the framework wants a list of supported 'nid's, it will call; 294 * If the framework wants a list of supported 'nid's, it will call;
294 * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error) 295 * foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
295 */ 296 */
296 /* Returns to a pointer to the array of supported cipher 'nid's. If the second 297 /* Returns to a pointer to the array of supported cipher 'nid's. If the second
297 * parameter is non-NULL it is set to the size of the returned array. */ 298 * parameter is non-NULL it is set to the size of the returned array. */
298 typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, i nt); 299 typedef int (*ENGINE_CIPHERS_PTR)(ENGINE *, const EVP_CIPHER **, const int **, i nt);
299 typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int); 300 typedef int (*ENGINE_DIGESTS_PTR)(ENGINE *, const EVP_MD **, const int **, int);
300 301 typedef int (*ENGINE_PKEY_METHS_PTR)(ENGINE *, EVP_PKEY_METHOD **, const int **, int);
302 typedef int (*ENGINE_PKEY_ASN1_METHS_PTR)(ENGINE *, EVP_PKEY_ASN1_METHOD **, con st int **, int);
301 /* STRUCTURE functions ... all of these functions deal with pointers to ENGINE 303 /* STRUCTURE functions ... all of these functions deal with pointers to ENGINE
302 * structures where the pointers have a "structural reference". This means that 304 * structures where the pointers have a "structural reference". This means that
303 * their reference is to allowed access to the structure but it does not imply 305 * their reference is to allowed access to the structure but it does not imply
304 * that the structure is functional. To simply increment or decrement the 306 * that the structure is functional. To simply increment or decrement the
305 * structural reference count, use ENGINE_by_id and ENGINE_free. NB: This is not 307 * structural reference count, use ENGINE_by_id and ENGINE_free. NB: This is not
306 * required when iterating using ENGINE_get_next as it will automatically 308 * required when iterating using ENGINE_get_next as it will automatically
307 * decrement the structural reference count of the "current" ENGINE and 309 * decrement the structural reference count of the "current" ENGINE and
308 * increment the structural reference count of the ENGINE it returns (unless it 310 * increment the structural reference count of the ENGINE it returns (unless it
309 * is NULL). */ 311 * is NULL). */
310 312
(...skipping 11 matching lines...) Expand all
322 ENGINE *ENGINE_by_id(const char *id); 324 ENGINE *ENGINE_by_id(const char *id);
323 /* Add all the built-in engines. */ 325 /* Add all the built-in engines. */
324 void ENGINE_load_openssl(void); 326 void ENGINE_load_openssl(void);
325 void ENGINE_load_dynamic(void); 327 void ENGINE_load_dynamic(void);
326 #ifndef OPENSSL_NO_STATIC_ENGINE 328 #ifndef OPENSSL_NO_STATIC_ENGINE
327 void ENGINE_load_4758cca(void); 329 void ENGINE_load_4758cca(void);
328 void ENGINE_load_aep(void); 330 void ENGINE_load_aep(void);
329 void ENGINE_load_atalla(void); 331 void ENGINE_load_atalla(void);
330 void ENGINE_load_chil(void); 332 void ENGINE_load_chil(void);
331 void ENGINE_load_cswift(void); 333 void ENGINE_load_cswift(void);
334 void ENGINE_load_nuron(void);
335 void ENGINE_load_sureware(void);
336 void ENGINE_load_ubsec(void);
337 void ENGINE_load_padlock(void);
338 void ENGINE_load_capi(void);
332 #ifndef OPENSSL_NO_GMP 339 #ifndef OPENSSL_NO_GMP
333 void ENGINE_load_gmp(void); 340 void ENGINE_load_gmp(void);
334 #endif 341 #endif
335 void ENGINE_load_nuron(void); 342 #ifndef OPENSSL_NO_GOST
336 void ENGINE_load_sureware(void); 343 void ENGINE_load_gost(void);
337 void ENGINE_load_ubsec(void); 344 #endif
338 #endif 345 #endif
339 void ENGINE_load_cryptodev(void); 346 void ENGINE_load_cryptodev(void);
340 void ENGINE_load_padlock(void);
341 void ENGINE_load_builtin_engines(void); 347 void ENGINE_load_builtin_engines(void);
342 #ifdef OPENSSL_SYS_WIN32
343 #ifndef OPENSSL_NO_CAPIENG
344 void ENGINE_load_capi(void);
345 #endif
346 #endif
347 348
348 /* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation 349 /* Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
349 * "registry" handling. */ 350 * "registry" handling. */
350 unsigned int ENGINE_get_table_flags(void); 351 unsigned int ENGINE_get_table_flags(void);
351 void ENGINE_set_table_flags(unsigned int flags); 352 void ENGINE_set_table_flags(unsigned int flags);
352 353
353 /* Manage registration of ENGINEs per "table". For each type, there are 3 354 /* Manage registration of ENGINEs per "table". For each type, there are 3
354 * functions; 355 * functions;
355 * ENGINE_register_***(e) - registers the implementation from 'e' (if it has o ne) 356 * ENGINE_register_***(e) - registers the implementation from 'e' (if it has o ne)
356 * ENGINE_unregister_***(e) - unregister the implementation from 'e' 357 * ENGINE_unregister_***(e) - unregister the implementation from 'e'
(...skipping 30 matching lines...) Expand all
387 void ENGINE_register_all_STORE(void); 388 void ENGINE_register_all_STORE(void);
388 389
389 int ENGINE_register_ciphers(ENGINE *e); 390 int ENGINE_register_ciphers(ENGINE *e);
390 void ENGINE_unregister_ciphers(ENGINE *e); 391 void ENGINE_unregister_ciphers(ENGINE *e);
391 void ENGINE_register_all_ciphers(void); 392 void ENGINE_register_all_ciphers(void);
392 393
393 int ENGINE_register_digests(ENGINE *e); 394 int ENGINE_register_digests(ENGINE *e);
394 void ENGINE_unregister_digests(ENGINE *e); 395 void ENGINE_unregister_digests(ENGINE *e);
395 void ENGINE_register_all_digests(void); 396 void ENGINE_register_all_digests(void);
396 397
398 int ENGINE_register_pkey_meths(ENGINE *e);
399 void ENGINE_unregister_pkey_meths(ENGINE *e);
400 void ENGINE_register_all_pkey_meths(void);
401
402 int ENGINE_register_pkey_asn1_meths(ENGINE *e);
403 void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
404 void ENGINE_register_all_pkey_asn1_meths(void);
405
397 /* These functions register all support from the above categories. Note, use of 406 /* These functions register all support from the above categories. Note, use of
398 * these functions can result in static linkage of code your application may not 407 * these functions can result in static linkage of code your application may not
399 * need. If you only need a subset of functionality, consider using more 408 * need. If you only need a subset of functionality, consider using more
400 * selective initialisation. */ 409 * selective initialisation. */
401 int ENGINE_register_complete(ENGINE *e); 410 int ENGINE_register_complete(ENGINE *e);
402 int ENGINE_register_all_complete(void); 411 int ENGINE_register_all_complete(void);
403 412
404 /* Send parametrised control commands to the engine. The possibilities to send 413 /* Send parametrised control commands to the engine. The possibilities to send
405 * down an integer, a pointer to data or a function pointer are provided. Any of 414 * down an integer, a pointer to data or a function pointer are provided. Any of
406 * the parameters may or may not be NULL, depending on the command number. In 415 * the parameters may or may not be NULL, depending on the command number. In
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
466 int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f); 475 int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
467 int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f); 476 int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
468 int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f); 477 int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
469 int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f); 478 int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
470 int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f); 479 int ENGINE_set_load_privkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpriv_f);
471 int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f); 480 int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
472 int ENGINE_set_load_ssl_client_cert_function(ENGINE *e, 481 int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
473 ENGINE_SSL_CLIENT_CERT_PTR loadssl_f); 482 ENGINE_SSL_CLIENT_CERT_PTR loadssl_f);
474 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f); 483 int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
475 int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f); 484 int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
485 int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
486 int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
476 int ENGINE_set_flags(ENGINE *e, int flags); 487 int ENGINE_set_flags(ENGINE *e, int flags);
477 int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns); 488 int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
478 /* These functions allow control over any per-structure ENGINE data. */ 489 /* These functions allow control over any per-structure ENGINE data. */
479 int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 490 int ENGINE_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
480 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 491 CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
481 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg); 492 int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
482 void *ENGINE_get_ex_data(const ENGINE *e, int idx); 493 void *ENGINE_get_ex_data(const ENGINE *e, int idx);
483 494
484 /* This function cleans up anything that needs it. Eg. the ENGINE_add() function 495 /* This function cleans up anything that needs it. Eg. the ENGINE_add() function
485 * automatically ensures the list cleanup function is registered to be called 496 * automatically ensures the list cleanup function is registered to be called
(...skipping 16 matching lines...) Expand all
502 const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e); 513 const STORE_METHOD *ENGINE_get_STORE(const ENGINE *e);
503 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e); 514 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
504 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e); 515 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
505 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e); 516 ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
506 ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e); 517 ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
507 ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e); 518 ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
508 ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e); 519 ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
509 ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e); 520 ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE *e);
510 ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e); 521 ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
511 ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e); 522 ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
523 ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
524 ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
512 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid); 525 const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
513 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid); 526 const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
527 const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
528 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
529 const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
530 const char *str, int len);
531 const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
532 const char *str, int len);
514 const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); 533 const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
515 int ENGINE_get_flags(const ENGINE *e); 534 int ENGINE_get_flags(const ENGINE *e);
516 535
517 /* FUNCTIONAL functions. These functions deal with ENGINE structures 536 /* FUNCTIONAL functions. These functions deal with ENGINE structures
518 * that have (or will) be initialised for use. Broadly speaking, the 537 * that have (or will) be initialised for use. Broadly speaking, the
519 * structural functions are useful for iterating the list of available 538 * structural functions are useful for iterating the list of available
520 * engine types, creating new engine types, and other "list" operations. 539 * engine types, creating new engine types, and other "list" operations.
521 * These functions actually deal with ENGINEs that are to be used. As 540 * These functions actually deal with ENGINEs that are to be used. As
522 * such these functions can fail (if applicable) when particular 541 * such these functions can fail (if applicable) when particular
523 * engines are unavailable - eg. if a hardware accelerator is not 542 * engines are unavailable - eg. if a hardware accelerator is not
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 /* Same for the other "methods" */ 574 /* Same for the other "methods" */
556 ENGINE *ENGINE_get_default_DSA(void); 575 ENGINE *ENGINE_get_default_DSA(void);
557 ENGINE *ENGINE_get_default_ECDH(void); 576 ENGINE *ENGINE_get_default_ECDH(void);
558 ENGINE *ENGINE_get_default_ECDSA(void); 577 ENGINE *ENGINE_get_default_ECDSA(void);
559 ENGINE *ENGINE_get_default_DH(void); 578 ENGINE *ENGINE_get_default_DH(void);
560 ENGINE *ENGINE_get_default_RAND(void); 579 ENGINE *ENGINE_get_default_RAND(void);
561 /* These functions can be used to get a functional reference to perform 580 /* These functions can be used to get a functional reference to perform
562 * ciphering or digesting corresponding to "nid". */ 581 * ciphering or digesting corresponding to "nid". */
563 ENGINE *ENGINE_get_cipher_engine(int nid); 582 ENGINE *ENGINE_get_cipher_engine(int nid);
564 ENGINE *ENGINE_get_digest_engine(int nid); 583 ENGINE *ENGINE_get_digest_engine(int nid);
584 ENGINE *ENGINE_get_pkey_meth_engine(int nid);
585 ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
565 586
566 /* This sets a new default ENGINE structure for performing RSA 587 /* This sets a new default ENGINE structure for performing RSA
567 * operations. If the result is non-zero (success) then the ENGINE 588 * operations. If the result is non-zero (success) then the ENGINE
568 * structure will have had its reference count up'd so the caller 589 * structure will have had its reference count up'd so the caller
569 * should still free their own reference 'e'. */ 590 * should still free their own reference 'e'. */
570 int ENGINE_set_default_RSA(ENGINE *e); 591 int ENGINE_set_default_RSA(ENGINE *e);
571 int ENGINE_set_default_string(ENGINE *e, const char *def_list); 592 int ENGINE_set_default_string(ENGINE *e, const char *def_list);
572 /* Same for the other "methods" */ 593 /* Same for the other "methods" */
573 int ENGINE_set_default_DSA(ENGINE *e); 594 int ENGINE_set_default_DSA(ENGINE *e);
574 int ENGINE_set_default_ECDH(ENGINE *e); 595 int ENGINE_set_default_ECDH(ENGINE *e);
575 int ENGINE_set_default_ECDSA(ENGINE *e); 596 int ENGINE_set_default_ECDSA(ENGINE *e);
576 int ENGINE_set_default_DH(ENGINE *e); 597 int ENGINE_set_default_DH(ENGINE *e);
577 int ENGINE_set_default_RAND(ENGINE *e); 598 int ENGINE_set_default_RAND(ENGINE *e);
578 int ENGINE_set_default_ciphers(ENGINE *e); 599 int ENGINE_set_default_ciphers(ENGINE *e);
579 int ENGINE_set_default_digests(ENGINE *e); 600 int ENGINE_set_default_digests(ENGINE *e);
601 int ENGINE_set_default_pkey_meths(ENGINE *e);
602 int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
580 603
581 /* The combination "set" - the flags are bitwise "OR"d from the 604 /* The combination "set" - the flags are bitwise "OR"d from the
582 * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()" 605 * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
583 * function, this function can result in unnecessary static linkage. If your 606 * function, this function can result in unnecessary static linkage. If your
584 * application requires only specific functionality, consider using more 607 * application requires only specific functionality, consider using more
585 * selective functions. */ 608 * selective functions. */
586 int ENGINE_set_default(ENGINE *e, unsigned int flags); 609 int ENGINE_set_default(ENGINE *e, unsigned int flags);
587 610
588 void ENGINE_add_conf_module(void); 611 void ENGINE_add_conf_module(void);
589 612
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code. 670 * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading code.
648 * If this function returns zero, it indicates a (potential) version 671 * If this function returns zero, it indicates a (potential) version
649 * incompatibility and the loaded library doesn't believe it can proceed. 672 * incompatibility and the loaded library doesn't believe it can proceed.
650 * Otherwise, the returned value is the (latest) version supported by the 673 * Otherwise, the returned value is the (latest) version supported by the
651 * loading library. The loader may still decide that the loaded code's version 674 * loading library. The loader may still decide that the loaded code's version
652 * is unsatisfactory and could veto the load. The function is expected to 675 * is unsatisfactory and could veto the load. The function is expected to
653 * be implemented with the symbol name "v_check", and a default implementation 676 * be implemented with the symbol name "v_check", and a default implementation
654 * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */ 677 * can be fully instantiated with IMPLEMENT_DYNAMIC_CHECK_FN(). */
655 typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version); 678 typedef unsigned long (*dynamic_v_check_fn)(unsigned long ossl_version);
656 #define IMPLEMENT_DYNAMIC_CHECK_FN() \ 679 #define IMPLEMENT_DYNAMIC_CHECK_FN() \
680 OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
657 OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \ 681 OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
658 if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \ 682 if(v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
659 return 0; } 683 return 0; }
660 684
661 /* This function is passed the ENGINE structure to initialise with its own 685 /* This function is passed the ENGINE structure to initialise with its own
662 * function and command settings. It should not adjust the structural or 686 * function and command settings. It should not adjust the structural or
663 * functional reference counts. If this function returns zero, (a) the load will 687 * functional reference counts. If this function returns zero, (a) the load will
664 * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the 688 * be aborted, (b) the previous ENGINE state will be memcpy'd back onto the
665 * structure, and (c) the shared library will be unloaded. So implementations 689 * structure, and (c) the shared library will be unloaded. So implementations
666 * should do their own internal cleanup in failure circumstances otherwise they 690 * should do their own internal cleanup in failure circumstances otherwise they
667 * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that 691 * could leak. The 'id' parameter, if non-NULL, represents the ENGINE id that
668 * the loader is looking for. If this is NULL, the shared library can choose to 692 * the loader is looking for. If this is NULL, the shared library can choose to
669 * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared 693 * return failure or to initialise a 'default' ENGINE. If non-NULL, the shared
670 * library must initialise only an ENGINE matching the passed 'id'. The function 694 * library must initialise only an ENGINE matching the passed 'id'. The function
671 * is expected to be implemented with the symbol name "bind_engine". A standard 695 * is expected to be implemented with the symbol name "bind_engine". A standard
672 * implementation can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where 696 * implementation can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where
673 * the parameter 'fn' is a callback function that populates the ENGINE structure 697 * the parameter 'fn' is a callback function that populates the ENGINE structure
674 * and returns an int value (zero for failure). 'fn' should have prototype; 698 * and returns an int value (zero for failure). 'fn' should have prototype;
675 * [static] int fn(ENGINE *e, const char *id); */ 699 * [static] int fn(ENGINE *e, const char *id); */
676 typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id, 700 typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
677 const dynamic_fns *fns); 701 const dynamic_fns *fns);
678 #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \ 702 #define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
679 OPENSSL_EXPORT \ 703 OPENSSL_EXPORT \
704 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
705 OPENSSL_EXPORT \
680 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \ 706 int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
681 if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs ; \ 707 if(ENGINE_get_static_state() == fns->static_state) goto skip_cbs ; \
682 if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \ 708 if(!CRYPTO_set_mem_functions(fns->mem_fns.malloc_cb, \
683 fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \ 709 fns->mem_fns.realloc_cb, fns->mem_fns.free_cb)) \
684 return 0; \ 710 return 0; \
685 CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \ 711 CRYPTO_set_locking_callback(fns->lock_fns.lock_locking_cb); \
686 CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \ 712 CRYPTO_set_add_lock_callback(fns->lock_fns.lock_add_lock_cb); \
687 CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_ cb); \ 713 CRYPTO_set_dynlock_create_callback(fns->lock_fns.dynlock_create_ cb); \
688 CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \ 714 CRYPTO_set_dynlock_lock_callback(fns->lock_fns.dynlock_lock_cb); \
689 CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destro y_cb); \ 715 CRYPTO_set_dynlock_destroy_callback(fns->lock_fns.dynlock_destro y_cb); \
690 if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \ 716 if(!CRYPTO_set_ex_data_implementation(fns->ex_data_fns)) \
691 return 0; \ 717 return 0; \
692 if(!ERR_set_implementation(fns->err_fns)) return 0; \ 718 if(!ERR_set_implementation(fns->err_fns)) return 0; \
693 skip_cbs: \ 719 skip_cbs: \
694 if(!fn(e,id)) return 0; \ 720 if(!fn(e,id)) return 0; \
695 return 1; } 721 return 1; }
696 722
697 /* If the loading application (or library) and the loaded ENGINE library share 723 /* If the loading application (or library) and the loaded ENGINE library share
698 * the same static data (eg. they're both dynamically linked to the same 724 * the same static data (eg. they're both dynamically linked to the same
699 * libcrypto.so) we need a way to avoid trying to set system callbacks - this 725 * libcrypto.so) we need a way to avoid trying to set system callbacks - this
700 * would fail, and for the same reason that it's unnecessary to try. If the 726 * would fail, and for the same reason that it's unnecessary to try. If the
701 * loaded ENGINE has (or gets from through the loader) its own copy of the 727 * loaded ENGINE has (or gets from through the loader) its own copy of the
702 * libcrypto static data, we will need to set the callbacks. The easiest way to 728 * libcrypto static data, we will need to set the callbacks. The easiest way to
703 * detect this is to have a function that returns a pointer to some static data 729 * detect this is to have a function that returns a pointer to some static data
704 * and let the loading application and loaded ENGINE compare their respective 730 * and let the loading application and loaded ENGINE compare their respective
705 * values. */ 731 * values. */
706 void *ENGINE_get_static_state(void); 732 void *ENGINE_get_static_state(void);
707 733
708 #if defined(__OpenBSD__) || defined(__FreeBSD__) 734 #if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV)
709 void ENGINE_setup_bsd_cryptodev(void); 735 void ENGINE_setup_bsd_cryptodev(void);
710 #endif 736 #endif
711 737
712 /* BEGIN ERROR CODES */ 738 /* BEGIN ERROR CODES */
713 /* The following lines are auto generated by the script mkerr.pl. Any changes 739 /* The following lines are auto generated by the script mkerr.pl. Any changes
714 * made after this point may be overwritten when the script is next run. 740 * made after this point may be overwritten when the script is next run.
715 */ 741 */
716 void ERR_load_ENGINE_strings(void); 742 void ERR_load_ENGINE_strings(void);
717 743
718 /* Error codes for the ENGINE functions. */ 744 /* Error codes for the ENGINE functions. */
719 745
720 /* Function codes. */ 746 /* Function codes. */
721 #define ENGINE_F_DYNAMIC_CTRL 180 747 #define ENGINE_F_DYNAMIC_CTRL 180
722 #define ENGINE_F_DYNAMIC_GET_DATA_CTX 181 748 #define ENGINE_F_DYNAMIC_GET_DATA_CTX 181
723 #define ENGINE_F_DYNAMIC_LOAD 182 749 #define ENGINE_F_DYNAMIC_LOAD 182
724 #define ENGINE_F_DYNAMIC_SET_DATA_CTX 183 750 #define ENGINE_F_DYNAMIC_SET_DATA_CTX 183
725 #define ENGINE_F_ENGINE_ADD 105 751 #define ENGINE_F_ENGINE_ADD 105
726 #define ENGINE_F_ENGINE_BY_ID 106 752 #define ENGINE_F_ENGINE_BY_ID 106
727 #define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170 753 #define ENGINE_F_ENGINE_CMD_IS_EXECUTABLE 170
728 #define ENGINE_F_ENGINE_CTRL 142 754 #define ENGINE_F_ENGINE_CTRL 142
729 #define ENGINE_F_ENGINE_CTRL_CMD 178 755 #define ENGINE_F_ENGINE_CTRL_CMD 178
730 #define ENGINE_F_ENGINE_CTRL_CMD_STRING 171 756 #define ENGINE_F_ENGINE_CTRL_CMD_STRING 171
731 #define ENGINE_F_ENGINE_FINISH 107 757 #define ENGINE_F_ENGINE_FINISH 107
732 #define ENGINE_F_ENGINE_FREE_UTIL 108 758 #define ENGINE_F_ENGINE_FREE_UTIL 108
733 #define ENGINE_F_ENGINE_GET_CIPHER 185 759 #define ENGINE_F_ENGINE_GET_CIPHER 185
734 #define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177 760 #define ENGINE_F_ENGINE_GET_DEFAULT_TYPE 177
735 #define ENGINE_F_ENGINE_GET_DIGEST 186 761 #define ENGINE_F_ENGINE_GET_DIGEST 186
736 #define ENGINE_F_ENGINE_GET_NEXT 115 762 #define ENGINE_F_ENGINE_GET_NEXT 115
763 #define ENGINE_F_ENGINE_GET_PKEY_ASN1_METH 193
764 #define ENGINE_F_ENGINE_GET_PKEY_METH 192
737 #define ENGINE_F_ENGINE_GET_PREV 116 765 #define ENGINE_F_ENGINE_GET_PREV 116
738 #define ENGINE_F_ENGINE_INIT 119 766 #define ENGINE_F_ENGINE_INIT 119
739 #define ENGINE_F_ENGINE_LIST_ADD 120 767 #define ENGINE_F_ENGINE_LIST_ADD 120
740 #define ENGINE_F_ENGINE_LIST_REMOVE 121 768 #define ENGINE_F_ENGINE_LIST_REMOVE 121
741 #define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150 769 #define ENGINE_F_ENGINE_LOAD_PRIVATE_KEY 150
742 #define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151 770 #define ENGINE_F_ENGINE_LOAD_PUBLIC_KEY 151
743 #define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT» » 192 771 #define ENGINE_F_ENGINE_LOAD_SSL_CLIENT_CERT» » 194
744 #define ENGINE_F_ENGINE_NEW 122 772 #define ENGINE_F_ENGINE_NEW 122
745 #define ENGINE_F_ENGINE_REMOVE 123 773 #define ENGINE_F_ENGINE_REMOVE 123
746 #define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189 774 #define ENGINE_F_ENGINE_SET_DEFAULT_STRING 189
747 #define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126 775 #define ENGINE_F_ENGINE_SET_DEFAULT_TYPE 126
748 #define ENGINE_F_ENGINE_SET_ID 129 776 #define ENGINE_F_ENGINE_SET_ID 129
749 #define ENGINE_F_ENGINE_SET_NAME 130 777 #define ENGINE_F_ENGINE_SET_NAME 130
750 #define ENGINE_F_ENGINE_TABLE_REGISTER 184 778 #define ENGINE_F_ENGINE_TABLE_REGISTER 184
751 #define ENGINE_F_ENGINE_UNLOAD_KEY 152 779 #define ENGINE_F_ENGINE_UNLOAD_KEY 152
752 #define ENGINE_F_ENGINE_UNLOCKED_FINISH 191 780 #define ENGINE_F_ENGINE_UNLOCKED_FINISH 191
753 #define ENGINE_F_ENGINE_UP_REF 190 781 #define ENGINE_F_ENGINE_UP_REF 190
754 #define ENGINE_F_INT_CTRL_HELPER 172 782 #define ENGINE_F_INT_CTRL_HELPER 172
755 #define ENGINE_F_INT_ENGINE_CONFIGURE 188 783 #define ENGINE_F_INT_ENGINE_CONFIGURE 188
756 #define ENGINE_F_INT_ENGINE_MODULE_INIT 187 784 #define ENGINE_F_INT_ENGINE_MODULE_INIT 187
757 #define ENGINE_F_LOG_MESSAGE 141 785 #define ENGINE_F_LOG_MESSAGE 141
758 786
759 /* Reason codes. */ 787 /* Reason codes. */
760 #define ENGINE_R_ALREADY_LOADED 100 788 #define ENGINE_R_ALREADY_LOADED 100
761 #define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133 789 #define ENGINE_R_ARGUMENT_IS_NOT_A_NUMBER 133
762 #define ENGINE_R_CMD_NOT_EXECUTABLE 134 790 #define ENGINE_R_CMD_NOT_EXECUTABLE 134
763 #define ENGINE_R_COMMAND_TAKES_INPUT 135 791 #define ENGINE_R_COMMAND_TAKES_INPUT 135
764 #define ENGINE_R_COMMAND_TAKES_NO_INPUT 136 792 #define ENGINE_R_COMMAND_TAKES_NO_INPUT 136
765 #define ENGINE_R_CONFLICTING_ENGINE_ID 103 793 #define ENGINE_R_CONFLICTING_ENGINE_ID 103
766 #define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119 794 #define ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED 119
767 #define ENGINE_R_DH_NOT_IMPLEMENTED 139 795 #define ENGINE_R_DH_NOT_IMPLEMENTED 139
768 #define ENGINE_R_DSA_NOT_IMPLEMENTED 140 796 #define ENGINE_R_DSA_NOT_IMPLEMENTED 140
769 #define ENGINE_R_DSO_FAILURE 104 797 #define ENGINE_R_DSO_FAILURE 104
770 #define ENGINE_R_DSO_NOT_FOUND 132 798 #define ENGINE_R_DSO_NOT_FOUND 132
771 #define ENGINE_R_ENGINES_SECTION_ERROR 148 799 #define ENGINE_R_ENGINES_SECTION_ERROR 148
772 #define ENGINE_R_ENGINE_CONFIGURATION_ERROR» » 101 800 #define ENGINE_R_ENGINE_CONFIGURATION_ERROR» » 102
773 #define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105 801 #define ENGINE_R_ENGINE_IS_NOT_IN_LIST 105
774 #define ENGINE_R_ENGINE_SECTION_ERROR 149 802 #define ENGINE_R_ENGINE_SECTION_ERROR 149
775 #define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128 803 #define ENGINE_R_FAILED_LOADING_PRIVATE_KEY 128
776 #define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129 804 #define ENGINE_R_FAILED_LOADING_PUBLIC_KEY 129
777 #define ENGINE_R_FINISH_FAILED 106 805 #define ENGINE_R_FINISH_FAILED 106
778 #define ENGINE_R_GET_HANDLE_FAILED 107 806 #define ENGINE_R_GET_HANDLE_FAILED 107
779 #define ENGINE_R_ID_OR_NAME_MISSING 108 807 #define ENGINE_R_ID_OR_NAME_MISSING 108
780 #define ENGINE_R_INIT_FAILED 109 808 #define ENGINE_R_INIT_FAILED 109
781 #define ENGINE_R_INTERNAL_LIST_ERROR 110 809 #define ENGINE_R_INTERNAL_LIST_ERROR 110
782 #define ENGINE_R_INVALID_ARGUMENT 143 810 #define ENGINE_R_INVALID_ARGUMENT 143
783 #define ENGINE_R_INVALID_CMD_NAME 137 811 #define ENGINE_R_INVALID_CMD_NAME 137
784 #define ENGINE_R_INVALID_CMD_NUMBER 138 812 #define ENGINE_R_INVALID_CMD_NUMBER 138
785 #define ENGINE_R_INVALID_INIT_VALUE 151 813 #define ENGINE_R_INVALID_INIT_VALUE 151
786 #define ENGINE_R_INVALID_STRING 150 814 #define ENGINE_R_INVALID_STRING 150
787 #define ENGINE_R_NOT_INITIALISED 117 815 #define ENGINE_R_NOT_INITIALISED 117
788 #define ENGINE_R_NOT_LOADED 112 816 #define ENGINE_R_NOT_LOADED 112
789 #define ENGINE_R_NO_CONTROL_FUNCTION 120 817 #define ENGINE_R_NO_CONTROL_FUNCTION 120
790 #define ENGINE_R_NO_INDEX 144 818 #define ENGINE_R_NO_INDEX 144
791 #define ENGINE_R_NO_LOAD_FUNCTION 125 819 #define ENGINE_R_NO_LOAD_FUNCTION 125
792 #define ENGINE_R_NO_REFERENCE 130 820 #define ENGINE_R_NO_REFERENCE 130
793 #define ENGINE_R_NO_SUCH_ENGINE 116 821 #define ENGINE_R_NO_SUCH_ENGINE 116
794 #define ENGINE_R_NO_UNLOAD_FUNCTION 126 822 #define ENGINE_R_NO_UNLOAD_FUNCTION 126
795 #define ENGINE_R_PROVIDE_PARAMETERS 113 823 #define ENGINE_R_PROVIDE_PARAMETERS 113
796 #define ENGINE_R_RSA_NOT_IMPLEMENTED 141 824 #define ENGINE_R_RSA_NOT_IMPLEMENTED 141
797 #define ENGINE_R_UNIMPLEMENTED_CIPHER 146 825 #define ENGINE_R_UNIMPLEMENTED_CIPHER 146
798 #define ENGINE_R_UNIMPLEMENTED_DIGEST 147 826 #define ENGINE_R_UNIMPLEMENTED_DIGEST 147
827 #define ENGINE_R_UNIMPLEMENTED_PUBLIC_KEY_METHOD 101
799 #define ENGINE_R_VERSION_INCOMPATIBILITY 145 828 #define ENGINE_R_VERSION_INCOMPATIBILITY 145
800 829
801 #ifdef __cplusplus 830 #ifdef __cplusplus
802 } 831 }
803 #endif 832 #endif
804 #endif 833 #endif
OLDNEW
« no previous file with comments | « openssl/crypto/engine/eng_table.c ('k') | openssl/crypto/engine/enginetest.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698