summaryrefslogtreecommitdiff
path: root/hmac_operation.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2014-12-17 08:36:20 -0700
committerShawn Willden <swillden@google.com>2015-02-05 13:54:29 -0700
commit62c2286bcf93bdfebac85bb5318982f054ec6224 (patch)
treeb6bd7b3f0575f0ee660ae1b1bef237400b30d4df /hmac_operation.cpp
parent0d560bfedd40389387f31f6696660fff6bc3a48a (diff)
downloadkeymaster-62c2286bcf93bdfebac85bb5318982f054ec6224.tar.gz
Add support for HMAC_SHA224, HMAC_SHA384 and HMAC_SHA512.
Change-Id: I76c73f6e16e5ee4acaf8a78eacd1bfdf3db12b68
Diffstat (limited to 'hmac_operation.cpp')
-rw-r--r--hmac_operation.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/hmac_operation.cpp b/hmac_operation.cpp
index 1620105..a179655 100644
--- a/hmac_operation.cpp
+++ b/hmac_operation.cpp
@@ -30,9 +30,18 @@ HmacOperation::HmacOperation(keymaster_purpose_t purpose, const Logger& logger,
const EVP_MD* md;
switch (digest) {
+ case KM_DIGEST_SHA_2_224:
+ md = EVP_sha224();
+ break;
case KM_DIGEST_SHA_2_256:
md = EVP_sha256();
break;
+ case KM_DIGEST_SHA_2_384:
+ md = EVP_sha384();
+ break;
+ case KM_DIGEST_SHA_2_512:
+ md = EVP_sha512();
+ break;
default:
error_ = KM_ERROR_UNSUPPORTED_DIGEST;
return;