aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/hmac/hmac.c
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2019-05-28 20:08:17 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2019-05-28 20:08:17 +0000
commit375b8e6770f750fb915859470f6f1fe43f35cc48 (patch)
tree5db6744924edfc112439ad2366f52f246baa21d1 /crypto/hmac/hmac.c
parent851f7386fd78b9787f4f6669ad271886a2a003f1 (diff)
downloadsrc-375b8e6770f750fb915859470f6f1fe43f35cc48.tar.gz
src-375b8e6770f750fb915859470f6f1fe43f35cc48.zip
Import OpenSSL 1.1.1c.vendor/openssl/1.1.1c
Notes
Notes: svn path=/vendor-crypto/openssl/dist/; revision=348333 svn path=/vendor-crypto/openssl/1.1.1c/; revision=348334; tag=vendor/openssl/1.1.1c
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r--crypto/hmac/hmac.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index e4031b44a576..0c0a7133fb5a 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -1,5 +1,5 @@
/*
- * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the OpenSSL license (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
@@ -35,6 +35,13 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
return 0;
}
+ /*
+ * The HMAC construction is not allowed to be used with the
+ * extendable-output functions (XOF) shake128 and shake256.
+ */
+ if ((EVP_MD_meth_get_flags(md) & EVP_MD_FLAG_XOF) != 0)
+ return 0;
+
if (key != NULL) {
reset = 1;
j = EVP_MD_block_size(md);