Remove engine_table_select_int

Add missing file/line args and call it engine_table_select

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15419)
This commit is contained in:
Rich Salz 2021-05-22 15:57:07 -04:00 committed by Pauli
parent 3c9f992aa0
commit a861711bcd
11 changed files with 22 additions and 15 deletions

View File

@ -62,10 +62,8 @@ int engine_table_register(ENGINE_TABLE **table, ENGINE_CLEANUP_CB *cleanup,
int setdefault); int setdefault);
void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e); void engine_table_unregister(ENGINE_TABLE **table, ENGINE *e);
void engine_table_cleanup(ENGINE_TABLE **table); void engine_table_cleanup(ENGINE_TABLE **table);
ENGINE *engine_table_select_int(ENGINE_TABLE **table, int nid, const char *f, ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
int l); const char *f, int l);
# define engine_table_select(t,n) \
engine_table_select_int(t,n,OPENSSL_FILE,OPENSSL_LINE)
typedef void (engine_table_doall_cb) (int nid, STACK_OF(ENGINE) *sk, typedef void (engine_table_doall_cb) (int nid, STACK_OF(ENGINE) *sk,
ENGINE *def, void *arg); ENGINE *def, void *arg);
void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb, void engine_table_doall(ENGINE_TABLE *table, engine_table_doall_cb *cb,

View File

@ -194,8 +194,8 @@ void engine_table_cleanup(ENGINE_TABLE **table)
} }
/* return a functional reference for a given 'nid' */ /* return a functional reference for a given 'nid' */
ENGINE *engine_table_select_int(ENGINE_TABLE **table, int nid, const char *f, ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
int l) const char *f, int l)
{ {
ENGINE *ret = NULL; ENGINE *ret = NULL;
ENGINE_PILE tmplate, *fnd = NULL; ENGINE_PILE tmplate, *fnd = NULL;

View File

@ -76,7 +76,8 @@ int ENGINE_set_default_pkey_asn1_meths(ENGINE *e)
*/ */
ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid) ENGINE *ENGINE_get_pkey_asn1_meth_engine(int nid)
{ {
return engine_table_select(&pkey_asn1_meth_table, nid); return ossl_engine_table_select(&pkey_asn1_meth_table, nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* /*

View File

@ -65,7 +65,8 @@ int ENGINE_set_default_ciphers(ENGINE *e)
*/ */
ENGINE *ENGINE_get_cipher_engine(int nid) ENGINE *ENGINE_get_cipher_engine(int nid)
{ {
return engine_table_select(&cipher_table, nid); return ossl_engine_table_select(&cipher_table, nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains a cipher implementation from an ENGINE functional reference */ /* Obtains a cipher implementation from an ENGINE functional reference */

View File

@ -58,7 +58,8 @@ int ENGINE_set_default_DH(ENGINE *e)
*/ */
ENGINE *ENGINE_get_default_DH(void) ENGINE *ENGINE_get_default_DH(void)
{ {
return engine_table_select(&dh_table, dummy_nid); return ossl_engine_table_select(&dh_table, dummy_nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains an DH implementation from an ENGINE functional reference */ /* Obtains an DH implementation from an ENGINE functional reference */

View File

@ -65,7 +65,8 @@ int ENGINE_set_default_digests(ENGINE *e)
*/ */
ENGINE *ENGINE_get_digest_engine(int nid) ENGINE *ENGINE_get_digest_engine(int nid)
{ {
return engine_table_select(&digest_table, nid); return ossl_engine_table_select(&digest_table, nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains a digest implementation from an ENGINE functional reference */ /* Obtains a digest implementation from an ENGINE functional reference */

View File

@ -58,7 +58,8 @@ int ENGINE_set_default_DSA(ENGINE *e)
*/ */
ENGINE *ENGINE_get_default_DSA(void) ENGINE *ENGINE_get_default_DSA(void)
{ {
return engine_table_select(&dsa_table, dummy_nid); return ossl_engine_table_select(&dsa_table, dummy_nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains an DSA implementation from an ENGINE functional reference */ /* Obtains an DSA implementation from an ENGINE functional reference */

View File

@ -58,7 +58,8 @@ int ENGINE_set_default_EC(ENGINE *e)
*/ */
ENGINE *ENGINE_get_default_EC(void) ENGINE *ENGINE_get_default_EC(void)
{ {
return engine_table_select(&dh_table, dummy_nid); return ossl_engine_table_select(&dh_table, dummy_nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains an EC_KEY implementation from an ENGINE functional reference */ /* Obtains an EC_KEY implementation from an ENGINE functional reference */

View File

@ -66,7 +66,8 @@ int ENGINE_set_default_pkey_meths(ENGINE *e)
*/ */
ENGINE *ENGINE_get_pkey_meth_engine(int nid) ENGINE *ENGINE_get_pkey_meth_engine(int nid)
{ {
return engine_table_select(&pkey_meth_table, nid); return ossl_engine_table_select(&pkey_meth_table, nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains a pkey_meth implementation from an ENGINE functional reference */ /* Obtains a pkey_meth implementation from an ENGINE functional reference */

View File

@ -58,7 +58,8 @@ int ENGINE_set_default_RAND(ENGINE *e)
*/ */
ENGINE *ENGINE_get_default_RAND(void) ENGINE *ENGINE_get_default_RAND(void)
{ {
return engine_table_select(&rand_table, dummy_nid); return ossl_engine_table_select(&rand_table, dummy_nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains an RAND implementation from an ENGINE functional reference */ /* Obtains an RAND implementation from an ENGINE functional reference */

View File

@ -58,7 +58,8 @@ int ENGINE_set_default_RSA(ENGINE *e)
*/ */
ENGINE *ENGINE_get_default_RSA(void) ENGINE *ENGINE_get_default_RSA(void)
{ {
return engine_table_select(&rsa_table, dummy_nid); return ossl_engine_table_select(&rsa_table, dummy_nid,
OPENSSL_FILE, OPENSSL_LINE);
} }
/* Obtains an RSA implementation from an ENGINE functional reference */ /* Obtains an RSA implementation from an ENGINE functional reference */