Blame include/openssl/engine.h

Packit c4476c
/*
Packit c4476c
 * Copyright 2000-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
 * Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
Packit c4476c
 *
Packit c4476c
 * Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
 * this file except in compliance with the License.  You can obtain a copy
Packit c4476c
 * in the file LICENSE in the source distribution or at
Packit c4476c
 * https://www.openssl.org/source/license.html
Packit c4476c
 */
Packit c4476c
Packit c4476c
#ifndef HEADER_ENGINE_H
Packit c4476c
# define HEADER_ENGINE_H
Packit c4476c
Packit c4476c
# include <openssl/opensslconf.h>
Packit c4476c
Packit c4476c
# ifndef OPENSSL_NO_ENGINE
Packit c4476c
# if OPENSSL_API_COMPAT < 0x10100000L
Packit c4476c
#  include <openssl/bn.h>
Packit c4476c
#  include <openssl/rsa.h>
Packit c4476c
#  include <openssl/dsa.h>
Packit c4476c
#  include <openssl/dh.h>
Packit c4476c
#  include <openssl/ec.h>
Packit c4476c
#  include <openssl/rand.h>
Packit c4476c
#  include <openssl/ui.h>
Packit c4476c
#  include <openssl/err.h>
Packit c4476c
# endif
Packit c4476c
# include <openssl/ossl_typ.h>
Packit c4476c
# include <openssl/symhacks.h>
Packit c4476c
# include <openssl/x509.h>
Packit c4476c
# include <openssl/engineerr.h>
Packit c4476c
# ifdef  __cplusplus
Packit c4476c
extern "C" {
Packit c4476c
# endif
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These flags are used to control combinations of algorithm (methods) by
Packit c4476c
 * bitwise "OR"ing.
Packit c4476c
 */
Packit c4476c
# define ENGINE_METHOD_RSA               (unsigned int)0x0001
Packit c4476c
# define ENGINE_METHOD_DSA               (unsigned int)0x0002
Packit c4476c
# define ENGINE_METHOD_DH                (unsigned int)0x0004
Packit c4476c
# define ENGINE_METHOD_RAND              (unsigned int)0x0008
Packit c4476c
# define ENGINE_METHOD_CIPHERS           (unsigned int)0x0040
Packit c4476c
# define ENGINE_METHOD_DIGESTS           (unsigned int)0x0080
Packit c4476c
# define ENGINE_METHOD_PKEY_METHS        (unsigned int)0x0200
Packit c4476c
# define ENGINE_METHOD_PKEY_ASN1_METHS   (unsigned int)0x0400
Packit c4476c
# define ENGINE_METHOD_EC                (unsigned int)0x0800
Packit c4476c
/* Obvious all-or-nothing cases. */
Packit c4476c
# define ENGINE_METHOD_ALL               (unsigned int)0xFFFF
Packit c4476c
# define ENGINE_METHOD_NONE              (unsigned int)0x0000
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This(ese) flag(s) controls behaviour of the ENGINE_TABLE mechanism used
Packit c4476c
 * internally to control registration of ENGINE implementations, and can be
Packit c4476c
 * set by ENGINE_set_table_flags(). The "NOINIT" flag prevents attempts to
Packit c4476c
 * initialise registered ENGINEs if they are not already initialised.
Packit c4476c
 */
Packit c4476c
# define ENGINE_TABLE_FLAG_NOINIT        (unsigned int)0x0001
Packit c4476c
Packit c4476c
/* ENGINE flags that can be set by ENGINE_set_flags(). */
Packit c4476c
/* Not used */
Packit c4476c
/* #define ENGINE_FLAGS_MALLOCED        0x0001 */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This flag is for ENGINEs that wish to handle the various 'CMD'-related
Packit c4476c
 * control commands on their own. Without this flag, ENGINE_ctrl() handles
Packit c4476c
 * these control commands on behalf of the ENGINE using their "cmd_defns"
Packit c4476c
 * data.
Packit c4476c
 */
Packit c4476c
# define ENGINE_FLAGS_MANUAL_CMD_CTRL    (int)0x0002
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This flag is for ENGINEs who return new duplicate structures when found
Packit c4476c
 * via "ENGINE_by_id()". When an ENGINE must store state (eg. if
Packit c4476c
 * ENGINE_ctrl() commands are called in sequence as part of some stateful
Packit c4476c
 * process like key-generation setup and execution), it can set this flag -
Packit c4476c
 * then each attempt to obtain the ENGINE will result in it being copied into
Packit c4476c
 * a new structure. Normally, ENGINEs don't declare this flag so
Packit c4476c
 * ENGINE_by_id() just increments the existing ENGINE's structural reference
Packit c4476c
 * count.
Packit c4476c
 */
Packit c4476c
# define ENGINE_FLAGS_BY_ID_COPY         (int)0x0004
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This flag if for an ENGINE that does not want its methods registered as
Packit c4476c
 * part of ENGINE_register_all_complete() for example if the methods are not
Packit c4476c
 * usable as default methods.
Packit c4476c
 */
Packit c4476c
Packit c4476c
# define ENGINE_FLAGS_NO_REGISTER_ALL    (int)0x0008
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * ENGINEs can support their own command types, and these flags are used in
Packit c4476c
 * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input
Packit c4476c
 * each command expects. Currently only numeric and string input is
Packit c4476c
 * supported. If a control command supports none of the _NUMERIC, _STRING, or
Packit c4476c
 * _NO_INPUT options, then it is regarded as an "internal" control command -
Packit c4476c
 * and not for use in config setting situations. As such, they're not
Packit c4476c
 * available to the ENGINE_ctrl_cmd_string() function, only raw ENGINE_ctrl()
Packit c4476c
 * access. Changes to this list of 'command types' should be reflected
Packit c4476c
 * carefully in ENGINE_cmd_is_executable() and ENGINE_ctrl_cmd_string().
Packit c4476c
 */
Packit c4476c
Packit c4476c
/* accepts a 'long' input value (3rd parameter to ENGINE_ctrl) */
Packit c4476c
# define ENGINE_CMD_FLAG_NUMERIC         (unsigned int)0x0001
Packit c4476c
/*
Packit c4476c
 * accepts string input (cast from 'void*' to 'const char *', 4th parameter
Packit c4476c
 * to ENGINE_ctrl)
Packit c4476c
 */
Packit c4476c
# define ENGINE_CMD_FLAG_STRING          (unsigned int)0x0002
Packit c4476c
/*
Packit c4476c
 * Indicates that the control command takes *no* input. Ie. the control
Packit c4476c
 * command is unparameterised.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CMD_FLAG_NO_INPUT        (unsigned int)0x0004
Packit c4476c
/*
Packit c4476c
 * Indicates that the control command is internal. This control command won't
Packit c4476c
 * be shown in any output, and is only usable through the ENGINE_ctrl_cmd()
Packit c4476c
 * function.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CMD_FLAG_INTERNAL        (unsigned int)0x0008
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * NB: These 3 control commands are deprecated and should not be used.
Packit c4476c
 * ENGINEs relying on these commands should compile conditional support for
Packit c4476c
 * compatibility (eg. if these symbols are defined) but should also migrate
Packit c4476c
 * the same functionality to their own ENGINE-specific control functions that
Packit c4476c
 * can be "discovered" by calling applications. The fact these control
Packit c4476c
 * commands wouldn't be "executable" (ie. usable by text-based config)
Packit c4476c
 * doesn't change the fact that application code can find and use them
Packit c4476c
 * without requiring per-ENGINE hacking.
Packit c4476c
 */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These flags are used to tell the ctrl function what should be done. All
Packit c4476c
 * command numbers are shared between all engines, even if some don't make
Packit c4476c
 * sense to some engines.  In such a case, they do nothing but return the
Packit c4476c
 * error ENGINE_R_CTRL_COMMAND_NOT_IMPLEMENTED.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_SET_LOGSTREAM               1
Packit c4476c
# define ENGINE_CTRL_SET_PASSWORD_CALLBACK       2
Packit c4476c
# define ENGINE_CTRL_HUP                         3/* Close and reinitialise
Packit c4476c
                                                   * any handles/connections
Packit c4476c
                                                   * etc. */
Packit c4476c
# define ENGINE_CTRL_SET_USER_INTERFACE          4/* Alternative to callback */
Packit c4476c
# define ENGINE_CTRL_SET_CALLBACK_DATA           5/* User-specific data, used
Packit c4476c
                                                   * when calling the password
Packit c4476c
                                                   * callback and the user
Packit c4476c
                                                   * interface */
Packit c4476c
# define ENGINE_CTRL_LOAD_CONFIGURATION          6/* Load a configuration,
Packit c4476c
                                                   * given a string that
Packit c4476c
                                                   * represents a file name
Packit c4476c
                                                   * or so */
Packit c4476c
# define ENGINE_CTRL_LOAD_SECTION                7/* Load data from a given
Packit c4476c
                                                   * section in the already
Packit c4476c
                                                   * loaded configuration */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These control commands allow an application to deal with an arbitrary
Packit c4476c
 * engine in a dynamic way. Warn: Negative return values indicate errors FOR
Packit c4476c
 * THESE COMMANDS because zero is used to indicate 'end-of-list'. Other
Packit c4476c
 * commands, including ENGINE-specific command types, return zero for an
Packit c4476c
 * error. An ENGINE can choose to implement these ctrl functions, and can
Packit c4476c
 * internally manage things however it chooses - it does so by setting the
Packit c4476c
 * ENGINE_FLAGS_MANUAL_CMD_CTRL flag (using ENGINE_set_flags()). Otherwise
Packit c4476c
 * the ENGINE_ctrl() code handles this on the ENGINE's behalf using the
Packit c4476c
 * cmd_defns data (set using ENGINE_set_cmd_defns()). This means an ENGINE's
Packit c4476c
 * ctrl() handler need only implement its own commands - the above "meta"
Packit c4476c
 * commands will be taken care of.
Packit c4476c
 */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * Returns non-zero if the supplied ENGINE has a ctrl() handler. If "not",
Packit c4476c
 * then all the remaining control commands will return failure, so it is
Packit c4476c
 * worth checking this first if the caller is trying to "discover" the
Packit c4476c
 * engine's capabilities and doesn't want errors generated unnecessarily.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_HAS_CTRL_FUNCTION           10
Packit c4476c
/*
Packit c4476c
 * Returns a positive command number for the first command supported by the
Packit c4476c
 * engine. Returns zero if no ctrl commands are supported.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_GET_FIRST_CMD_TYPE          11
Packit c4476c
/*
Packit c4476c
 * The 'long' argument specifies a command implemented by the engine, and the
Packit c4476c
 * return value is the next command supported, or zero if there are no more.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_GET_NEXT_CMD_TYPE           12
Packit c4476c
/*
Packit c4476c
 * The 'void*' argument is a command name (cast from 'const char *'), and the
Packit c4476c
 * return value is the command that corresponds to it.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_GET_CMD_FROM_NAME           13
Packit c4476c
/*
Packit c4476c
 * The next two allow a command to be converted into its corresponding string
Packit c4476c
 * form. In each case, the 'long' argument supplies the command. In the
Packit c4476c
 * NAME_LEN case, the return value is the length of the command name (not
Packit c4476c
 * counting a trailing EOL). In the NAME case, the 'void*' argument must be a
Packit c4476c
 * string buffer large enough, and it will be populated with the name of the
Packit c4476c
 * command (WITH a trailing EOL).
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_GET_NAME_LEN_FROM_CMD       14
Packit c4476c
# define ENGINE_CTRL_GET_NAME_FROM_CMD           15
Packit c4476c
/* The next two are similar but give a "short description" of a command. */
Packit c4476c
# define ENGINE_CTRL_GET_DESC_LEN_FROM_CMD       16
Packit c4476c
# define ENGINE_CTRL_GET_DESC_FROM_CMD           17
Packit c4476c
/*
Packit c4476c
 * With this command, the return value is the OR'd combination of
Packit c4476c
 * ENGINE_CMD_FLAG_*** values that indicate what kind of input a given
Packit c4476c
 * engine-specific ctrl command expects.
Packit c4476c
 */
Packit c4476c
# define ENGINE_CTRL_GET_CMD_FLAGS               18
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * ENGINE implementations should start the numbering of their own control
Packit c4476c
 * commands from this value. (ie. ENGINE_CMD_BASE, ENGINE_CMD_BASE + 1, etc).
Packit c4476c
 */
Packit c4476c
# define ENGINE_CMD_BASE                         200
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * NB: These 2 nCipher "chil" control commands are deprecated, and their
Packit c4476c
 * functionality is now available through ENGINE-specific control commands
Packit c4476c
 * (exposed through the above-mentioned 'CMD'-handling). Code using these 2
Packit c4476c
 * commands should be migrated to the more general command handling before
Packit c4476c
 * these are removed.
Packit c4476c
 */
Packit c4476c
Packit c4476c
/* Flags specific to the nCipher "chil" engine */
Packit c4476c
# define ENGINE_CTRL_CHIL_SET_FORKCHECK          100
Packit c4476c
        /*
Packit c4476c
         * Depending on the value of the (long)i argument, this sets or
Packit c4476c
         * unsets the SimpleForkCheck flag in the CHIL API to enable or
Packit c4476c
         * disable checking and workarounds for applications that fork().
Packit c4476c
         */
Packit c4476c
# define ENGINE_CTRL_CHIL_NO_LOCKING             101
Packit c4476c
        /*
Packit c4476c
         * This prevents the initialisation function from providing mutex
Packit c4476c
         * callbacks to the nCipher library.
Packit c4476c
         */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * If an ENGINE supports its own specific control commands and wishes the
Packit c4476c
 * framework to handle the above 'ENGINE_CMD_***'-manipulation commands on
Packit c4476c
 * its behalf, it should supply a null-terminated array of ENGINE_CMD_DEFN
Packit c4476c
 * entries to ENGINE_set_cmd_defns(). It should also implement a ctrl()
Packit c4476c
 * handler that supports the stated commands (ie. the "cmd_num" entries as
Packit c4476c
 * described by the array). NB: The array must be ordered in increasing order
Packit c4476c
 * of cmd_num. "null-terminated" means that the last ENGINE_CMD_DEFN element
Packit c4476c
 * has cmd_num set to zero and/or cmd_name set to NULL.
Packit c4476c
 */
Packit c4476c
typedef struct ENGINE_CMD_DEFN_st {
Packit c4476c
    unsigned int cmd_num;       /* The command number */
Packit c4476c
    const char *cmd_name;       /* The command name itself */
Packit c4476c
    const char *cmd_desc;       /* A short description of the command */
Packit c4476c
    unsigned int cmd_flags;     /* The input the command expects */
Packit c4476c
} ENGINE_CMD_DEFN;
Packit c4476c
Packit c4476c
/* Generic function pointer */
Packit c4476c
typedef int (*ENGINE_GEN_FUNC_PTR) (void);
Packit c4476c
/* Generic function pointer taking no arguments */
Packit c4476c
typedef int (*ENGINE_GEN_INT_FUNC_PTR) (ENGINE *);
Packit c4476c
/* Specific control function pointer */
Packit c4476c
typedef int (*ENGINE_CTRL_FUNC_PTR) (ENGINE *, int, long, void *,
Packit c4476c
                                     void (*f) (void));
Packit c4476c
/* Generic load_key function pointer */
Packit c4476c
typedef EVP_PKEY *(*ENGINE_LOAD_KEY_PTR)(ENGINE *, const char *,
Packit c4476c
                                         UI_METHOD *ui_method,
Packit c4476c
                                         void *callback_data);
Packit c4476c
typedef int (*ENGINE_SSL_CLIENT_CERT_PTR) (ENGINE *, SSL *ssl,
Packit c4476c
                                           STACK_OF(X509_NAME) *ca_dn,
Packit c4476c
                                           X509 **pcert, EVP_PKEY **pkey,
Packit c4476c
                                           STACK_OF(X509) **pother,
Packit c4476c
                                           UI_METHOD *ui_method,
Packit c4476c
                                           void *callback_data);
Packit c4476c
/*-
Packit c4476c
 * These callback types are for an ENGINE's handler for cipher and digest logic.
Packit c4476c
 * These handlers have these prototypes;
Packit c4476c
 *   int foo(ENGINE *e, const EVP_CIPHER **cipher, const int **nids, int nid);
Packit c4476c
 *   int foo(ENGINE *e, const EVP_MD **digest, const int **nids, int nid);
Packit c4476c
 * Looking at how to implement these handlers in the case of cipher support, if
Packit c4476c
 * the framework wants the EVP_CIPHER for 'nid', it will call;
Packit c4476c
 *   foo(e, &p_evp_cipher, NULL, nid);    (return zero for failure)
Packit c4476c
 * If the framework wants a list of supported 'nid's, it will call;
Packit c4476c
 *   foo(e, NULL, &p_nids, 0); (returns number of 'nids' or -1 for error)
Packit c4476c
 */
Packit c4476c
/*
Packit c4476c
 * Returns to a pointer to the array of supported cipher 'nid's. If the
Packit c4476c
 * second parameter is non-NULL it is set to the size of the returned array.
Packit c4476c
 */
Packit c4476c
typedef int (*ENGINE_CIPHERS_PTR) (ENGINE *, const EVP_CIPHER **,
Packit c4476c
                                   const int **, int);
Packit c4476c
typedef int (*ENGINE_DIGESTS_PTR) (ENGINE *, const EVP_MD **, const int **,
Packit c4476c
                                   int);
Packit c4476c
typedef int (*ENGINE_PKEY_METHS_PTR) (ENGINE *, EVP_PKEY_METHOD **,
Packit c4476c
                                      const int **, int);
Packit c4476c
typedef int (*ENGINE_PKEY_ASN1_METHS_PTR) (ENGINE *, EVP_PKEY_ASN1_METHOD **,
Packit c4476c
                                           const int **, int);
Packit c4476c
/*
Packit c4476c
 * STRUCTURE functions ... all of these functions deal with pointers to
Packit c4476c
 * ENGINE structures where the pointers have a "structural reference". This
Packit c4476c
 * means that their reference is to allowed access to the structure but it
Packit c4476c
 * does not imply that the structure is functional. To simply increment or
Packit c4476c
 * decrement the structural reference count, use ENGINE_by_id and
Packit c4476c
 * ENGINE_free. NB: This is not required when iterating using ENGINE_get_next
Packit c4476c
 * as it will automatically decrement the structural reference count of the
Packit c4476c
 * "current" ENGINE and increment the structural reference count of the
Packit c4476c
 * ENGINE it returns (unless it is NULL).
Packit c4476c
 */
Packit c4476c
Packit c4476c
/* Get the first/last "ENGINE" type available. */
Packit c4476c
ENGINE *ENGINE_get_first(void);
Packit c4476c
ENGINE *ENGINE_get_last(void);
Packit c4476c
/* Iterate to the next/previous "ENGINE" type (NULL = end of the list). */
Packit c4476c
ENGINE *ENGINE_get_next(ENGINE *e);
Packit c4476c
ENGINE *ENGINE_get_prev(ENGINE *e);
Packit c4476c
/* Add another "ENGINE" type into the array. */
Packit c4476c
int ENGINE_add(ENGINE *e);
Packit c4476c
/* Remove an existing "ENGINE" type from the array. */
Packit c4476c
int ENGINE_remove(ENGINE *e);
Packit c4476c
/* Retrieve an engine from the list by its unique "id" value. */
Packit c4476c
ENGINE *ENGINE_by_id(const char *id);
Packit c4476c
Packit c4476c
#if OPENSSL_API_COMPAT < 0x10100000L
Packit c4476c
# define ENGINE_load_openssl() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_OPENSSL, NULL)
Packit c4476c
# define ENGINE_load_dynamic() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_DYNAMIC, NULL)
Packit c4476c
# ifndef OPENSSL_NO_STATIC_ENGINE
Packit c4476c
#  define ENGINE_load_padlock() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_PADLOCK, NULL)
Packit c4476c
#  define ENGINE_load_capi() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CAPI, NULL)
Packit c4476c
#  define ENGINE_load_afalg() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_AFALG, NULL)
Packit c4476c
# endif
Packit c4476c
# define ENGINE_load_cryptodev() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_CRYPTODEV, NULL)
Packit c4476c
# define ENGINE_load_rdrand() \
Packit c4476c
    OPENSSL_init_crypto(OPENSSL_INIT_ENGINE_RDRAND, NULL)
Packit c4476c
#endif
Packit c4476c
void ENGINE_load_builtin_engines(void);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * Get and set global flags (ENGINE_TABLE_FLAG_***) for the implementation
Packit c4476c
 * "registry" handling.
Packit c4476c
 */
Packit c4476c
unsigned int ENGINE_get_table_flags(void);
Packit c4476c
void ENGINE_set_table_flags(unsigned int flags);
Packit c4476c
Packit c4476c
/*- Manage registration of ENGINEs per "table". For each type, there are 3
Packit c4476c
 * functions;
Packit c4476c
 *   ENGINE_register_***(e) - registers the implementation from 'e' (if it has one)
Packit c4476c
 *   ENGINE_unregister_***(e) - unregister the implementation from 'e'
Packit c4476c
 *   ENGINE_register_all_***() - call ENGINE_register_***() for each 'e' in the list
Packit c4476c
 * Cleanup is automatically registered from each table when required.
Packit c4476c
 */
Packit c4476c
Packit c4476c
int ENGINE_register_RSA(ENGINE *e);
Packit c4476c
void ENGINE_unregister_RSA(ENGINE *e);
Packit c4476c
void ENGINE_register_all_RSA(void);
Packit c4476c
Packit c4476c
int ENGINE_register_DSA(ENGINE *e);
Packit c4476c
void ENGINE_unregister_DSA(ENGINE *e);
Packit c4476c
void ENGINE_register_all_DSA(void);
Packit c4476c
Packit c4476c
int ENGINE_register_EC(ENGINE *e);
Packit c4476c
void ENGINE_unregister_EC(ENGINE *e);
Packit c4476c
void ENGINE_register_all_EC(void);
Packit c4476c
Packit c4476c
int ENGINE_register_DH(ENGINE *e);
Packit c4476c
void ENGINE_unregister_DH(ENGINE *e);
Packit c4476c
void ENGINE_register_all_DH(void);
Packit c4476c
Packit c4476c
int ENGINE_register_RAND(ENGINE *e);
Packit c4476c
void ENGINE_unregister_RAND(ENGINE *e);
Packit c4476c
void ENGINE_register_all_RAND(void);
Packit c4476c
Packit c4476c
int ENGINE_register_ciphers(ENGINE *e);
Packit c4476c
void ENGINE_unregister_ciphers(ENGINE *e);
Packit c4476c
void ENGINE_register_all_ciphers(void);
Packit c4476c
Packit c4476c
int ENGINE_register_digests(ENGINE *e);
Packit c4476c
void ENGINE_unregister_digests(ENGINE *e);
Packit c4476c
void ENGINE_register_all_digests(void);
Packit c4476c
Packit c4476c
int ENGINE_register_pkey_meths(ENGINE *e);
Packit c4476c
void ENGINE_unregister_pkey_meths(ENGINE *e);
Packit c4476c
void ENGINE_register_all_pkey_meths(void);
Packit c4476c
Packit c4476c
int ENGINE_register_pkey_asn1_meths(ENGINE *e);
Packit c4476c
void ENGINE_unregister_pkey_asn1_meths(ENGINE *e);
Packit c4476c
void ENGINE_register_all_pkey_asn1_meths(void);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These functions register all support from the above categories. Note, use
Packit c4476c
 * of these functions can result in static linkage of code your application
Packit c4476c
 * may not need. If you only need a subset of functionality, consider using
Packit c4476c
 * more selective initialisation.
Packit c4476c
 */
Packit c4476c
int ENGINE_register_complete(ENGINE *e);
Packit c4476c
int ENGINE_register_all_complete(void);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * Send parameterised control commands to the engine. The possibilities to
Packit c4476c
 * send down an integer, a pointer to data or a function pointer are
Packit c4476c
 * provided. Any of the parameters may or may not be NULL, depending on the
Packit c4476c
 * command number. In actuality, this function only requires a structural
Packit c4476c
 * (rather than functional) reference to an engine, but many control commands
Packit c4476c
 * may require the engine be functional. The caller should be aware of trying
Packit c4476c
 * commands that require an operational ENGINE, and only use functional
Packit c4476c
 * references in such situations.
Packit c4476c
 */
Packit c4476c
int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f) (void));
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This function tests if an ENGINE-specific command is usable as a
Packit c4476c
 * "setting". Eg. in an application's config file that gets processed through
Packit c4476c
 * ENGINE_ctrl_cmd_string(). If this returns zero, it is not available to
Packit c4476c
 * ENGINE_ctrl_cmd_string(), only ENGINE_ctrl().
Packit c4476c
 */
Packit c4476c
int ENGINE_cmd_is_executable(ENGINE *e, int cmd);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This function works like ENGINE_ctrl() with the exception of taking a
Packit c4476c
 * command name instead of a command number, and can handle optional
Packit c4476c
 * commands. See the comment on ENGINE_ctrl_cmd_string() for an explanation
Packit c4476c
 * on how to use the cmd_name and cmd_optional.
Packit c4476c
 */
Packit c4476c
int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name,
Packit c4476c
                    long i, void *p, void (*f) (void), int cmd_optional);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This function passes a command-name and argument to an ENGINE. The
Packit c4476c
 * cmd_name is converted to a command number and the control command is
Packit c4476c
 * called using 'arg' as an argument (unless the ENGINE doesn't support such
Packit c4476c
 * a command, in which case no control command is called). The command is
Packit c4476c
 * checked for input flags, and if necessary the argument will be converted
Packit c4476c
 * to a numeric value. If cmd_optional is non-zero, then if the ENGINE
Packit c4476c
 * doesn't support the given cmd_name the return value will be success
Packit c4476c
 * anyway. This function is intended for applications to use so that users
Packit c4476c
 * (or config files) can supply engine-specific config data to the ENGINE at
Packit c4476c
 * run-time to control behaviour of specific engines. As such, it shouldn't
Packit c4476c
 * be used for calling ENGINE_ctrl() functions that return data, deal with
Packit c4476c
 * binary data, or that are otherwise supposed to be used directly through
Packit c4476c
 * ENGINE_ctrl() in application code. Any "return" data from an ENGINE_ctrl()
Packit c4476c
 * operation in this function will be lost - the return value is interpreted
Packit c4476c
 * as failure if the return value is zero, success otherwise, and this
Packit c4476c
 * function returns a boolean value as a result. In other words, vendors of
Packit c4476c
 * 'ENGINE'-enabled devices should write ENGINE implementations with
Packit c4476c
 * parameterisations that work in this scheme, so that compliant ENGINE-based
Packit c4476c
 * applications can work consistently with the same configuration for the
Packit c4476c
 * same ENGINE-enabled devices, across applications.
Packit c4476c
 */
Packit c4476c
int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg,
Packit c4476c
                           int cmd_optional);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These functions are useful for manufacturing new ENGINE structures. They
Packit c4476c
 * don't address reference counting at all - one uses them to populate an
Packit c4476c
 * ENGINE structure with personalised implementations of things prior to
Packit c4476c
 * using it directly or adding it to the builtin ENGINE list in OpenSSL.
Packit c4476c
 * These are also here so that the ENGINE structure doesn't have to be
Packit c4476c
 * exposed and break binary compatibility!
Packit c4476c
 */
Packit c4476c
ENGINE *ENGINE_new(void);
Packit c4476c
int ENGINE_free(ENGINE *e);
Packit c4476c
int ENGINE_up_ref(ENGINE *e);
Packit c4476c
int ENGINE_set_id(ENGINE *e, const char *id);
Packit c4476c
int ENGINE_set_name(ENGINE *e, const char *name);
Packit c4476c
int ENGINE_set_RSA(ENGINE *e, const RSA_METHOD *rsa_meth);
Packit c4476c
int ENGINE_set_DSA(ENGINE *e, const DSA_METHOD *dsa_meth);
Packit c4476c
int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ecdsa_meth);
Packit c4476c
int ENGINE_set_DH(ENGINE *e, const DH_METHOD *dh_meth);
Packit c4476c
int ENGINE_set_RAND(ENGINE *e, const RAND_METHOD *rand_meth);
Packit c4476c
int ENGINE_set_destroy_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR destroy_f);
Packit c4476c
int ENGINE_set_init_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR init_f);
Packit c4476c
int ENGINE_set_finish_function(ENGINE *e, ENGINE_GEN_INT_FUNC_PTR finish_f);
Packit c4476c
int ENGINE_set_ctrl_function(ENGINE *e, ENGINE_CTRL_FUNC_PTR ctrl_f);
Packit c4476c
int ENGINE_set_load_privkey_function(ENGINE *e,
Packit c4476c
                                     ENGINE_LOAD_KEY_PTR loadpriv_f);
Packit c4476c
int ENGINE_set_load_pubkey_function(ENGINE *e, ENGINE_LOAD_KEY_PTR loadpub_f);
Packit c4476c
int ENGINE_set_load_ssl_client_cert_function(ENGINE *e,
Packit c4476c
                                             ENGINE_SSL_CLIENT_CERT_PTR
Packit c4476c
                                             loadssl_f);
Packit c4476c
int ENGINE_set_ciphers(ENGINE *e, ENGINE_CIPHERS_PTR f);
Packit c4476c
int ENGINE_set_digests(ENGINE *e, ENGINE_DIGESTS_PTR f);
Packit c4476c
int ENGINE_set_pkey_meths(ENGINE *e, ENGINE_PKEY_METHS_PTR f);
Packit c4476c
int ENGINE_set_pkey_asn1_meths(ENGINE *e, ENGINE_PKEY_ASN1_METHS_PTR f);
Packit c4476c
int ENGINE_set_flags(ENGINE *e, int flags);
Packit c4476c
int ENGINE_set_cmd_defns(ENGINE *e, const ENGINE_CMD_DEFN *defns);
Packit c4476c
/* These functions allow control over any per-structure ENGINE data. */
Packit c4476c
#define ENGINE_get_ex_new_index(l, p, newf, dupf, freef) \
Packit c4476c
    CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_ENGINE, l, p, newf, dupf, freef)
Packit c4476c
int ENGINE_set_ex_data(ENGINE *e, int idx, void *arg);
Packit c4476c
void *ENGINE_get_ex_data(const ENGINE *e, int idx);
Packit c4476c
Packit c4476c
#if OPENSSL_API_COMPAT < 0x10100000L
Packit c4476c
/*
Packit c4476c
 * This function previously cleaned up anything that needs it. Auto-deinit will
Packit c4476c
 * now take care of it so it is no longer required to call this function.
Packit c4476c
 */
Packit c4476c
# define ENGINE_cleanup() while(0) continue
Packit c4476c
#endif
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * These return values from within the ENGINE structure. These can be useful
Packit c4476c
 * with functional references as well as structural references - it depends
Packit c4476c
 * which you obtained. Using the result for functional purposes if you only
Packit c4476c
 * obtained a structural reference may be problematic!
Packit c4476c
 */
Packit c4476c
const char *ENGINE_get_id(const ENGINE *e);
Packit c4476c
const char *ENGINE_get_name(const ENGINE *e);
Packit c4476c
const RSA_METHOD *ENGINE_get_RSA(const ENGINE *e);
Packit c4476c
const DSA_METHOD *ENGINE_get_DSA(const ENGINE *e);
Packit c4476c
const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e);
Packit c4476c
const DH_METHOD *ENGINE_get_DH(const ENGINE *e);
Packit c4476c
const RAND_METHOD *ENGINE_get_RAND(const ENGINE *e);
Packit c4476c
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_destroy_function(const ENGINE *e);
Packit c4476c
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_init_function(const ENGINE *e);
Packit c4476c
ENGINE_GEN_INT_FUNC_PTR ENGINE_get_finish_function(const ENGINE *e);
Packit c4476c
ENGINE_CTRL_FUNC_PTR ENGINE_get_ctrl_function(const ENGINE *e);
Packit c4476c
ENGINE_LOAD_KEY_PTR ENGINE_get_load_privkey_function(const ENGINE *e);
Packit c4476c
ENGINE_LOAD_KEY_PTR ENGINE_get_load_pubkey_function(const ENGINE *e);
Packit c4476c
ENGINE_SSL_CLIENT_CERT_PTR ENGINE_get_ssl_client_cert_function(const ENGINE
Packit c4476c
                                                               *e);
Packit c4476c
ENGINE_CIPHERS_PTR ENGINE_get_ciphers(const ENGINE *e);
Packit c4476c
ENGINE_DIGESTS_PTR ENGINE_get_digests(const ENGINE *e);
Packit c4476c
ENGINE_PKEY_METHS_PTR ENGINE_get_pkey_meths(const ENGINE *e);
Packit c4476c
ENGINE_PKEY_ASN1_METHS_PTR ENGINE_get_pkey_asn1_meths(const ENGINE *e);
Packit c4476c
const EVP_CIPHER *ENGINE_get_cipher(ENGINE *e, int nid);
Packit c4476c
const EVP_MD *ENGINE_get_digest(ENGINE *e, int nid);
Packit c4476c
const EVP_PKEY_METHOD *ENGINE_get_pkey_meth(ENGINE *e, int nid);
Packit c4476c
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth(ENGINE *e, int nid);
Packit c4476c
const EVP_PKEY_ASN1_METHOD *ENGINE_get_pkey_asn1_meth_str(ENGINE *e,
Packit c4476c
                                                          const char *str,
Packit c4476c
                                                          int len);
Packit c4476c
const EVP_PKEY_ASN1_METHOD *ENGINE_pkey_asn1_find_str(ENGINE **pe,
Packit c4476c
                                                      const char *str,
Packit c4476c
                                                      int len);
Packit c4476c
const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e);
Packit c4476c
int ENGINE_get_flags(const ENGINE *e);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * FUNCTIONAL functions. These functions deal with ENGINE structures that
Packit c4476c
 * have (or will) be initialised for use. Broadly speaking, the structural
Packit c4476c
 * functions are useful for iterating the list of available engine types,
Packit c4476c
 * creating new engine types, and other "list" operations. These functions
Packit c4476c
 * actually deal with ENGINEs that are to be used. As such these functions
Packit c4476c
 * can fail (if applicable) when particular engines are unavailable - eg. if
Packit c4476c
 * a hardware accelerator is not attached or not functioning correctly. Each
Packit c4476c
 * ENGINE has 2 reference counts; structural and functional. Every time a
Packit c4476c
 * functional reference is obtained or released, a corresponding structural
Packit c4476c
 * reference is automatically obtained or released too.
Packit c4476c
 */
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * Initialise a engine type for use (or up its reference count if it's
Packit c4476c
 * already in use). This will fail if the engine is not currently operational
Packit c4476c
 * and cannot initialise.
Packit c4476c
 */
Packit c4476c
int ENGINE_init(ENGINE *e);
Packit c4476c
/*
Packit c4476c
 * Free a functional reference to a engine type. This does not require a
Packit c4476c
 * corresponding call to ENGINE_free as it also releases a structural
Packit c4476c
 * reference.
Packit c4476c
 */
Packit c4476c
int ENGINE_finish(ENGINE *e);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * The following functions handle keys that are stored in some secondary
Packit c4476c
 * location, handled by the engine.  The storage may be on a card or
Packit c4476c
 * whatever.
Packit c4476c
 */
Packit c4476c
EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id,
Packit c4476c
                                  UI_METHOD *ui_method, void *callback_data);
Packit c4476c
EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id,
Packit c4476c
                                 UI_METHOD *ui_method, void *callback_data);
Packit c4476c
int ENGINE_load_ssl_client_cert(ENGINE *e, SSL *s,
Packit c4476c
                                STACK_OF(X509_NAME) *ca_dn, X509 **pcert,
Packit c4476c
                                EVP_PKEY **ppkey, STACK_OF(X509) **pother,
Packit c4476c
                                UI_METHOD *ui_method, void *callback_data);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This returns a pointer for the current ENGINE structure that is (by
Packit c4476c
 * default) performing any RSA operations. The value returned is an
Packit c4476c
 * incremented reference, so it should be free'd (ENGINE_finish) before it is
Packit c4476c
 * discarded.
Packit c4476c
 */
Packit c4476c
ENGINE *ENGINE_get_default_RSA(void);
Packit c4476c
/* Same for the other "methods" */
Packit c4476c
ENGINE *ENGINE_get_default_DSA(void);
Packit c4476c
ENGINE *ENGINE_get_default_EC(void);
Packit c4476c
ENGINE *ENGINE_get_default_DH(void);
Packit c4476c
ENGINE *ENGINE_get_default_RAND(void);
Packit c4476c
/*
Packit c4476c
 * These functions can be used to get a functional reference to perform
Packit c4476c
 * ciphering or digesting corresponding to "nid".
Packit c4476c
 */
Packit c4476c
ENGINE *ENGINE_get_cipher_engine(int nid);
Packit c4476c
ENGINE *ENGINE_get_digest_engine(int nid);
Packit c4476c
ENGINE *ENGINE_get_pkey_meth_engine(int nid);
Packit c4476c
ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This sets a new default ENGINE structure for performing RSA operations. If
Packit c4476c
 * the result is non-zero (success) then the ENGINE structure will have had
Packit c4476c
 * its reference count up'd so the caller should still free their own
Packit c4476c
 * reference 'e'.
Packit c4476c
 */
Packit c4476c
int ENGINE_set_default_RSA(ENGINE *e);
Packit c4476c
int ENGINE_set_default_string(ENGINE *e, const char *def_list);
Packit c4476c
/* Same for the other "methods" */
Packit c4476c
int ENGINE_set_default_DSA(ENGINE *e);
Packit c4476c
int ENGINE_set_default_EC(ENGINE *e);
Packit c4476c
int ENGINE_set_default_DH(ENGINE *e);
Packit c4476c
int ENGINE_set_default_RAND(ENGINE *e);
Packit c4476c
int ENGINE_set_default_ciphers(ENGINE *e);
Packit c4476c
int ENGINE_set_default_digests(ENGINE *e);
Packit c4476c
int ENGINE_set_default_pkey_meths(ENGINE *e);
Packit c4476c
int ENGINE_set_default_pkey_asn1_meths(ENGINE *e);
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * The combination "set" - the flags are bitwise "OR"d from the
Packit c4476c
 * ENGINE_METHOD_*** defines above. As with the "ENGINE_register_complete()"
Packit c4476c
 * function, this function can result in unnecessary static linkage. If your
Packit c4476c
 * application requires only specific functionality, consider using more
Packit c4476c
 * selective functions.
Packit c4476c
 */
Packit c4476c
int ENGINE_set_default(ENGINE *e, unsigned int flags);
Packit c4476c
Packit c4476c
void ENGINE_add_conf_module(void);
Packit c4476c
Packit c4476c
/* Deprecated functions ... */
Packit c4476c
/* int ENGINE_clear_defaults(void); */
Packit c4476c
Packit c4476c
/**************************/
Packit c4476c
/* DYNAMIC ENGINE SUPPORT */
Packit c4476c
/**************************/
Packit c4476c
Packit c4476c
/* Binary/behaviour compatibility levels */
Packit c4476c
# define OSSL_DYNAMIC_VERSION            (unsigned long)0x00030000
Packit c4476c
/*
Packit c4476c
 * Binary versions older than this are too old for us (whether we're a loader
Packit c4476c
 * or a loadee)
Packit c4476c
 */
Packit c4476c
# define OSSL_DYNAMIC_OLDEST             (unsigned long)0x00030000
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * When compiling an ENGINE entirely as an external shared library, loadable
Packit c4476c
 * by the "dynamic" ENGINE, these types are needed. The 'dynamic_fns'
Packit c4476c
 * structure type provides the calling application's (or library's) error
Packit c4476c
 * functionality and memory management function pointers to the loaded
Packit c4476c
 * library. These should be used/set in the loaded library code so that the
Packit c4476c
 * loading application's 'state' will be used/changed in all operations. The
Packit c4476c
 * 'static_state' pointer allows the loaded library to know if it shares the
Packit c4476c
 * same static data as the calling application (or library), and thus whether
Packit c4476c
 * these callbacks need to be set or not.
Packit c4476c
 */
Packit c4476c
typedef void *(*dyn_MEM_malloc_fn) (size_t, const char *, int);
Packit c4476c
typedef void *(*dyn_MEM_realloc_fn) (void *, size_t, const char *, int);
Packit c4476c
typedef void (*dyn_MEM_free_fn) (void *, const char *, int);
Packit c4476c
typedef struct st_dynamic_MEM_fns {
Packit c4476c
    dyn_MEM_malloc_fn malloc_fn;
Packit c4476c
    dyn_MEM_realloc_fn realloc_fn;
Packit c4476c
    dyn_MEM_free_fn free_fn;
Packit c4476c
} dynamic_MEM_fns;
Packit c4476c
/*
Packit c4476c
 * FIXME: Perhaps the memory and locking code (crypto.h) should declare and
Packit c4476c
 * use these types so we (and any other dependent code) can simplify a bit??
Packit c4476c
 */
Packit c4476c
/* The top-level structure */
Packit c4476c
typedef struct st_dynamic_fns {
Packit c4476c
    void *static_state;
Packit c4476c
    dynamic_MEM_fns mem_fns;
Packit c4476c
} dynamic_fns;
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * The version checking function should be of this prototype. NB: The
Packit c4476c
 * ossl_version value passed in is the OSSL_DYNAMIC_VERSION of the loading
Packit c4476c
 * code. If this function returns zero, it indicates a (potential) version
Packit c4476c
 * incompatibility and the loaded library doesn't believe it can proceed.
Packit c4476c
 * Otherwise, the returned value is the (latest) version supported by the
Packit c4476c
 * loading library. The loader may still decide that the loaded code's
Packit c4476c
 * version is unsatisfactory and could veto the load. The function is
Packit c4476c
 * expected to be implemented with the symbol name "v_check", and a default
Packit c4476c
 * implementation can be fully instantiated with
Packit c4476c
 * IMPLEMENT_DYNAMIC_CHECK_FN().
Packit c4476c
 */
Packit c4476c
typedef unsigned long (*dynamic_v_check_fn) (unsigned long ossl_version);
Packit c4476c
# define IMPLEMENT_DYNAMIC_CHECK_FN() \
Packit c4476c
        OPENSSL_EXPORT unsigned long v_check(unsigned long v); \
Packit c4476c
        OPENSSL_EXPORT unsigned long v_check(unsigned long v) { \
Packit c4476c
                if (v >= OSSL_DYNAMIC_OLDEST) return OSSL_DYNAMIC_VERSION; \
Packit c4476c
                return 0; }
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * This function is passed the ENGINE structure to initialise with its own
Packit c4476c
 * function and command settings. It should not adjust the structural or
Packit c4476c
 * functional reference counts. If this function returns zero, (a) the load
Packit c4476c
 * will be aborted, (b) the previous ENGINE state will be memcpy'd back onto
Packit c4476c
 * the structure, and (c) the shared library will be unloaded. So
Packit c4476c
 * implementations should do their own internal cleanup in failure
Packit c4476c
 * circumstances otherwise they could leak. The 'id' parameter, if non-NULL,
Packit c4476c
 * represents the ENGINE id that the loader is looking for. If this is NULL,
Packit c4476c
 * the shared library can choose to return failure or to initialise a
Packit c4476c
 * 'default' ENGINE. If non-NULL, the shared library must initialise only an
Packit c4476c
 * ENGINE matching the passed 'id'. The function is expected to be
Packit c4476c
 * implemented with the symbol name "bind_engine". A standard implementation
Packit c4476c
 * can be instantiated with IMPLEMENT_DYNAMIC_BIND_FN(fn) where the parameter
Packit c4476c
 * 'fn' is a callback function that populates the ENGINE structure and
Packit c4476c
 * returns an int value (zero for failure). 'fn' should have prototype;
Packit c4476c
 * [static] int fn(ENGINE *e, const char *id);
Packit c4476c
 */
Packit c4476c
typedef int (*dynamic_bind_engine) (ENGINE *e, const char *id,
Packit c4476c
                                    const dynamic_fns *fns);
Packit c4476c
# define IMPLEMENT_DYNAMIC_BIND_FN(fn) \
Packit c4476c
        OPENSSL_EXPORT \
Packit c4476c
        int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns); \
Packit c4476c
        OPENSSL_EXPORT \
Packit c4476c
        int bind_engine(ENGINE *e, const char *id, const dynamic_fns *fns) { \
Packit c4476c
            if (ENGINE_get_static_state() == fns->static_state) goto skip_cbs; \
Packit c4476c
            CRYPTO_set_mem_functions(fns->mem_fns.malloc_fn, \
Packit c4476c
                                     fns->mem_fns.realloc_fn, \
Packit c4476c
                                     fns->mem_fns.free_fn); \
Packit c4476c
        skip_cbs: \
Packit c4476c
            if (!fn(e, id)) return 0; \
Packit c4476c
            return 1; }
Packit c4476c
Packit c4476c
/*
Packit c4476c
 * If the loading application (or library) and the loaded ENGINE library
Packit c4476c
 * share the same static data (eg. they're both dynamically linked to the
Packit c4476c
 * same libcrypto.so) we need a way to avoid trying to set system callbacks -
Packit c4476c
 * this would fail, and for the same reason that it's unnecessary to try. If
Packit c4476c
 * the loaded ENGINE has (or gets from through the loader) its own copy of
Packit c4476c
 * the libcrypto static data, we will need to set the callbacks. The easiest
Packit c4476c
 * way to detect this is to have a function that returns a pointer to some
Packit c4476c
 * static data and let the loading application and loaded ENGINE compare
Packit c4476c
 * their respective values.
Packit c4476c
 */
Packit c4476c
void *ENGINE_get_static_state(void);
Packit c4476c
Packit c4476c
# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
Packit c4476c
DEPRECATEDIN_1_1_0(void ENGINE_setup_bsd_cryptodev(void))
Packit c4476c
# endif
Packit c4476c
Packit c4476c
Packit c4476c
#  ifdef  __cplusplus
Packit c4476c
}
Packit c4476c
#  endif
Packit c4476c
# endif
Packit c4476c
#endif