summaryrefslogtreecommitdiff
path: root/crypto/evp/p_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2018-03-19 10:35:16 +0000
committerMatt Caswell <matt@openssl.org>2018-03-19 12:38:01 +0000
commitdf6d51e2e4599da2c85e04e919bf30db3744af20 (patch)
treefd3cad27228f63174ccf03b8e59f9a3c0bbf1d6f /crypto/evp/p_lib.c
parent66a925ea8c91d883bd0603bcee5705025b564bd6 (diff)
downloadopenssl-new-df6d51e2e4599da2c85e04e919bf30db3744af20.tar.gz
Fix no-cmac
Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/5665)
Diffstat (limited to 'crypto/evp/p_lib.c')
-rw-r--r--crypto/evp/p_lib.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index c1b3393aa9..deaea4ac34 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -283,6 +283,7 @@ EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
size_t len, const EVP_CIPHER *cipher)
{
+#ifndef OPENSSL_NO_CMAC
EVP_PKEY *ret = EVP_PKEY_new();
CMAC_CTX *cmctx = CMAC_CTX_new();
@@ -305,7 +306,11 @@ EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
EVP_PKEY_free(ret);
CMAC_CTX_free(cmctx);
return NULL;
-
+#else
+ EVPerr(EVP_F_EVP_PKEY_NEW_CMAC_KEY,
+ EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
+ return NULL;
+#endif
}
int EVP_PKEY_set_type(EVP_PKEY *pkey, int type)