Use centralized hasher names in pki utility

This commit is contained in:
Martin Willi
2012-07-17 17:32:05 +02:00
parent 6719889e0a
commit c63fb853e8
6 changed files with 8 additions and 45 deletions
-32
View File
@@ -79,38 +79,6 @@ bool get_form(char *form, cred_encoding_type_t *enc, credential_type_t type)
return FALSE;
}
/**
* Convert a digest string to a hash algorithm
*/
hash_algorithm_t get_digest(char *name)
{
if (streq(name, "md5"))
{
return HASH_MD5;
}
if (streq(name, "sha1"))
{
return HASH_SHA1;
}
if (streq(name, "sha224"))
{
return HASH_SHA224;
}
if (streq(name, "sha256"))
{
return HASH_SHA256;
}
if (streq(name, "sha384"))
{
return HASH_SHA384;
}
if (streq(name, "sha512"))
{
return HASH_SHA512;
}
return HASH_UNKNOWN;
}
/**
* Callback credential set pki uses
*/