diff options
Diffstat (limited to 'src/common/crypto.c')
-rw-r--r-- | src/common/crypto.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index ac0e628c4..f335f99ab 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -1481,6 +1481,18 @@ crypto_digest_algorithm_get_name(digest_algorithm_t alg) } } +/** DOCDOC */ +int +crypto_digest_algorithm_parse_name(const char *name) +{ + if (!strcmp(name, "sha1")) + return DIGEST_SHA1; + else if (!strcmp(name, "sha256")) + return DIGEST_SHA256; + else + return -1; +} + /** Intermediate information about the digest of a stream of data. */ struct crypto_digest_env_t { union { |