summaryrefslogtreecommitdiff
path: root/hmac_operation.cpp
diff options
context:
space:
mode:
authorShawn Willden <swillden@google.com>2015-05-25 23:12:48 -0600
committerShawn Willden <swillden@google.com>2015-05-31 09:28:56 -0600
commit0629810b145187575bc26c910dded0d24c64569d (patch)
tree5c1309696f2205777f6aad1c1b5b65aeaa64c9b7 /hmac_operation.cpp
parent6270aca8571399aca8ea538acd7386ddecdcc112 (diff)
downloadkeymaster-0629810b145187575bc26c910dded0d24c64569d.tar.gz
Another refactor, deleting AbstractFactoryRegistry.
I should have known better than to make these singletons to begin with. Globals create problems. This undoes that mistake. Change-Id: Idf61d5f72e3c34b5c4ddb27cc94b05f506561743
Diffstat (limited to 'hmac_operation.cpp')
-rw-r--r--hmac_operation.cpp32
1 files changed, 0 insertions, 32 deletions
diff --git a/hmac_operation.cpp b/hmac_operation.cpp
index f11b388..1792487 100644
--- a/hmac_operation.cpp
+++ b/hmac_operation.cpp
@@ -31,22 +31,6 @@ typedef int openssl_size_t;
namespace keymaster {
-/**
- * Abstract base for HMAC operation factories. This class does all of the work to create
- * HMAC operations.
- */
-class HmacOperationFactory : public OperationFactory {
- public:
- virtual KeyType registry_key() const { return KeyType(KM_ALGORITHM_HMAC, purpose()); }
-
- virtual Operation* CreateOperation(const Key& key, const AuthorizationSet& begin_params,
- keymaster_error_t* error);
-
- virtual const keymaster_digest_t* SupportedDigests(size_t* digest_count) const;
-
- virtual keymaster_purpose_t purpose() const = 0;
-};
-
Operation* HmacOperationFactory::CreateOperation(const Key& key,
const AuthorizationSet& begin_params,
keymaster_error_t* error) {
@@ -92,22 +76,6 @@ const keymaster_digest_t* HmacOperationFactory::SupportedDigests(size_t* digest_
return supported_digests;
}
-/**
- * Concrete factory for creating HMAC signing operations.
- */
-class HmacSignOperationFactory : public HmacOperationFactory {
- keymaster_purpose_t purpose() const { return KM_PURPOSE_SIGN; }
-};
-static OperationFactoryRegistry::Registration<HmacSignOperationFactory> sign_registration;
-
-/**
- * Concrete factory for creating HMAC verification operations.
- */
-class HmacVerifyOperationFactory : public HmacOperationFactory {
- keymaster_purpose_t purpose() const { return KM_PURPOSE_VERIFY; }
-};
-static OperationFactoryRegistry::Registration<HmacVerifyOperationFactory> verify_registration;
-
HmacOperation::HmacOperation(keymaster_purpose_t purpose, const uint8_t* key_data,
size_t key_data_size, keymaster_digest_t digest, size_t tag_length)
: Operation(purpose), error_(KM_ERROR_OK), tag_length_(tag_length) {