diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2009-03-30 11:31:50 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2009-03-30 11:31:50 +0000 |
commit | aaf35f11d760ca64981d6633c4816193d1ea6145 (patch) | |
tree | 0ee2072c9bded051e91f407367a73dec39508701 /apps | |
parent | 093f5d2c152489dd7733dcbb68cbf654988a496c (diff) | |
download | openssl-aaf35f11d760ca64981d6633c4816193d1ea6145.tar.gz |
Allow use of algorithm and cipher names for dgsts and enc utilities instead
of having to manually include each one.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/openssl.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/openssl.c b/apps/openssl.c index 5d61d171ca..c9d9fe9288 100644 --- a/apps/openssl.c +++ b/apps/openssl.c @@ -392,6 +392,21 @@ static int do_cmd(LHASH_OF(FUNCTION) *prog, int argc, char *argv[]) { ret=0; goto end; } f.name=argv[0]; fp=lh_FUNCTION_retrieve(prog,&f); + if (fp == NULL) + { + if (EVP_get_digestbyname(argv[0])) + { + f.type = FUNC_TYPE_MD; + f.func = dgst_main; + fp = &f; + } + else if (EVP_get_cipherbyname(argv[0])) + { + f.type = FUNC_TYPE_CIPHER; + f.func = enc_main; + fp = &f; + } + } if (fp != NULL) { ret=fp->func(argc,argv); |