summaryrefslogtreecommitdiff
path: root/providers/implementations/ciphers/cipher_tdes_common.c
diff options
context:
space:
mode:
authorPatrick Steuer <patrick.steuer@de.ibm.com>2020-04-09 19:58:02 +0200
committerPatrick Steuer <patrick.steuer@de.ibm.com>2020-04-11 00:31:57 +0200
commitabfc73f374c2b80e15f6c9d0b3a7437b3e94afa8 (patch)
tree783be6935ef526392d31db6686c08fea08619502 /providers/implementations/ciphers/cipher_tdes_common.c
parentcc572c25647f6ab0c026a4a3057dc706e4a4a412 (diff)
downloadopenssl-new-abfc73f374c2b80e15f6c9d0b3a7437b3e94afa8.tar.gz
Fix EVP_DigestSign interface when used with DES CMAC
DES implementations were missing the dup/copy ctx routines required by CMAC implementation. A regression test is added. Signed-off-by: Patrick Steuer <patrick.steuer@de.ibm.com> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11498)
Diffstat (limited to 'providers/implementations/ciphers/cipher_tdes_common.c')
-rw-r--r--providers/implementations/ciphers/cipher_tdes_common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/providers/implementations/ciphers/cipher_tdes_common.c b/providers/implementations/ciphers/cipher_tdes_common.c
index 36a8962e03..4e50450e4d 100644
--- a/providers/implementations/ciphers/cipher_tdes_common.c
+++ b/providers/implementations/ciphers/cipher_tdes_common.c
@@ -30,6 +30,20 @@ void *tdes_newctx(void *provctx, int mode, size_t kbits, size_t blkbits,
return tctx;
}
+void *tdes_dupctx(void *ctx)
+{
+ PROV_TDES_CTX *in = (PROV_TDES_CTX *)ctx;
+ PROV_TDES_CTX *ret = OPENSSL_malloc(sizeof(*ret));
+
+ if (ret == NULL) {
+ ERR_raise(ERR_LIB_PROV, ERR_R_MALLOC_FAILURE);
+ return NULL;
+ }
+ in->base.hw->copyctx(&ret->base, &in->base);
+
+ return ret;
+}
+
void tdes_freectx(void *vctx)
{
PROV_TDES_CTX *ctx = (PROV_TDES_CTX *)vctx;