diff options
Diffstat (limited to 'crypto/engine')
-rw-r--r-- | crypto/engine/eng_fat.c | 5 | ||||
-rw-r--r-- | crypto/engine/eng_int.h | 2 | ||||
-rw-r--r-- | crypto/engine/eng_list.c | 2 | ||||
-rw-r--r-- | crypto/engine/tb_eckey.c | 30 |
4 files changed, 22 insertions, 17 deletions
diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c index 7984a5bf21..79d30bc8f5 100644 --- a/crypto/engine/eng_fat.c +++ b/crypto/engine/eng_fat.c @@ -80,6 +80,8 @@ int ENGINE_set_default(ENGINE *e, unsigned int flags) return 0; #endif #ifndef OPENSSL_NO_EC + if ((flags & ENGINE_METHOD_EC) && !ENGINE_set_default_EC(e)) + return 0; #endif if ((flags & ENGINE_METHOD_RAND) && !ENGINE_set_default_RAND(e)) return 0; @@ -107,6 +109,8 @@ static int int_def_cb(const char *alg, int len, void *arg) *pflags |= ENGINE_METHOD_DSA; else if (strncmp(alg, "DH", len) == 0) *pflags |= ENGINE_METHOD_DH; + else if (strncmp(alg, "EC", len) == 0) + *pflags |= ENGINE_METHOD_EC; else if (strncmp(alg, "RAND", len) == 0) *pflags |= ENGINE_METHOD_RAND; else if (strncmp(alg, "CIPHERS", len) == 0) @@ -150,6 +154,7 @@ int ENGINE_register_complete(ENGINE *e) ENGINE_register_DH(e); #endif #ifndef OPENSSL_NO_EC + ENGINE_register_EC(e); #endif ENGINE_register_RAND(e); ENGINE_register_pkey_meths(e); diff --git a/crypto/engine/eng_int.h b/crypto/engine/eng_int.h index eea5e3d298..2a0a9d452f 100644 --- a/crypto/engine/eng_int.h +++ b/crypto/engine/eng_int.h @@ -179,7 +179,7 @@ struct engine_st { const RSA_METHOD *rsa_meth; const DSA_METHOD *dsa_meth; const DH_METHOD *dh_meth; - const EC_KEY_METHOD *ec_key_meth; + const EC_KEY_METHOD *ec_meth; const RAND_METHOD *rand_meth; const STORE_METHOD *store_meth; /* Cipher handling is via this callback */ diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c index 72d3a17f19..f7739bae5e 100644 --- a/crypto/engine/eng_list.c +++ b/crypto/engine/eng_list.c @@ -302,7 +302,7 @@ static void engine_cpy(ENGINE *dest, const ENGINE *src) dest->dh_meth = src->dh_meth; #endif #ifndef OPENSSL_NO_EC - + dest->ec_meth = src->ec_meth; #endif dest->rand_meth = src->rand_meth; dest->store_meth = src->store_meth; diff --git a/crypto/engine/tb_eckey.c b/crypto/engine/tb_eckey.c index a3a4a23f81..a1cffe8159 100644 --- a/crypto/engine/tb_eckey.c +++ b/crypto/engine/tb_eckey.c @@ -64,38 +64,38 @@ static ENGINE_TABLE *dh_table = NULL; static const int dummy_nid = 1; -void ENGINE_unregister_EC_KEY(ENGINE *e) +void ENGINE_unregister_EC(ENGINE *e) { engine_table_unregister(&dh_table, e); } -static void engine_unregister_all_EC_KEY(void) +static void engine_unregister_all_EC(void) { engine_table_cleanup(&dh_table); } -int ENGINE_register_EC_KEY(ENGINE *e) +int ENGINE_register_EC(ENGINE *e) { - if (e->ec_key_meth) + if (e->ec_meth) return engine_table_register(&dh_table, - engine_unregister_all_EC_KEY, e, &dummy_nid, + engine_unregister_all_EC, e, &dummy_nid, 1, 0); return 1; } -void ENGINE_register_all_EC_KEY() +void ENGINE_register_all_EC() { ENGINE *e; for (e = ENGINE_get_first(); e; e = ENGINE_get_next(e)) - ENGINE_register_EC_KEY(e); + ENGINE_register_EC(e); } -int ENGINE_set_default_EC_KEY(ENGINE *e) +int ENGINE_set_default_EC(ENGINE *e) { - if (e->ec_key_meth) + if (e->ec_meth) return engine_table_register(&dh_table, - engine_unregister_all_EC_KEY, e, &dummy_nid, + engine_unregister_all_EC, e, &dummy_nid, 1, 1); return 1; } @@ -105,20 +105,20 @@ int ENGINE_set_default_EC_KEY(ENGINE *e) * table (ie. try to get a functional reference from the tabled structural * references). */ -ENGINE *ENGINE_get_default_EC_KEY(void) +ENGINE *ENGINE_get_default_EC(void) { return engine_table_select(&dh_table, dummy_nid); } /* Obtains an EC_KEY implementation from an ENGINE functional reference */ -const EC_KEY_METHOD *ENGINE_get_EC_KEY(const ENGINE *e) +const EC_KEY_METHOD *ENGINE_get_EC(const ENGINE *e) { - return e->ec_key_meth; + return e->ec_meth; } /* Sets an EC_KEY implementation in an ENGINE structure */ -int ENGINE_set_EC_KEY(ENGINE *e, const EC_KEY_METHOD *ec_key_meth) +int ENGINE_set_EC(ENGINE *e, const EC_KEY_METHOD *ec_meth) { - e->ec_key_meth = ec_key_meth; + e->ec_meth = ec_meth; return 1; } |