aboutsummaryrefslogtreecommitdiff
path: root/crypto/engine
diff options
context:
space:
mode:
authorBen Laurie <ben@openssl.org>2001-08-18 13:53:01 +0000
committerBen Laurie <ben@openssl.org>2001-08-18 13:53:01 +0000
commit0e36019977e78c34d6ea67b943fe17d4a01e769d (patch)
treef9669c6bae5c1a8ea211f73225b39fd6b5c64984 /crypto/engine
parent354c3ace73db6eafa235b6db948060a2ab82bb7b (diff)
downloadopenssl-0e36019977e78c34d6ea67b943fe17d4a01e769d.zip
openssl-0e36019977e78c34d6ea67b943fe17d4a01e769d.tar.gz
openssl-0e36019977e78c34d6ea67b943fe17d4a01e769d.tar.bz2
Add EVP test program.
Diffstat (limited to 'crypto/engine')
-rw-r--r--crypto/engine/engine.h4
-rw-r--r--crypto/engine/engine_evp.c14
2 files changed, 18 insertions, 0 deletions
diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h
index 9955582..0558f20 100644
--- a/crypto/engine/engine.h
+++ b/crypto/engine/engine.h
@@ -483,6 +483,10 @@ int ENGINE_clear_defaults(void);
/* Instruct an engine to load any EVP ciphers it knows of */
/* XXX make this work via defaults? */
void ENGINE_load_engine_ciphers(ENGINE *e);
+/* Get a particular cipher from a particular engine - NULL if the engine
+ * doesn't have it */
+const EVP_CIPHER *ENGINE_get_cipher_by_name(ENGINE *e,const char *name);
+
/* Obligatory error function. */
void ERR_load_ENGINE_strings(void);
diff --git a/crypto/engine/engine_evp.c b/crypto/engine/engine_evp.c
index ffd1bff..b2fbdc6 100644
--- a/crypto/engine/engine_evp.c
+++ b/crypto/engine/engine_evp.c
@@ -96,3 +96,17 @@ void ENGINE_load_engine_ciphers(ENGINE *e)
for(n=0 ; n < sk_ENGINE_EVP_CIPHER_num(e->ciphers) ; ++n)
EVP_add_cipher(sk_ENGINE_EVP_CIPHER_value(e->ciphers,n)->cipher);
}
+
+const EVP_CIPHER *ENGINE_get_cipher_by_name(ENGINE *e,const char *name)
+ {
+ int n;
+
+ for(n=0 ; n < ENGINE_cipher_num(e) ; ++n)
+ {
+ const EVP_CIPHER *c=ENGINE_get_cipher(e,n);
+
+ if(!strcmp(EVP_CIPHER_name(c),name))
+ return c;
+ }
+ return NULL;
+ }