]> wagner.pp.ru Git - openssl-gost/engine.git/commitdiff
Fix EVP_MD_CTX_copy_ex for OMAC
authorVitaly Chikunov <vt@altlinux.org>
Wed, 1 Aug 2018 21:03:06 +0000 (00:03 +0300)
committerVitaly Chikunov <vt@altlinux.org>
Wed, 1 Aug 2018 22:18:05 +0000 (01:18 +0300)
Openssl copies a state between valid contexts. But, EVP_MD_CTX_copy_ex
just memcpy-s private data (md_data), which points to OMAC_CTX), which
have pointer to CMAC_CTX. Copying pointer makes CMAC context just the
same on the both sides. As a consequence, we can not do normal copy of a
state between CMAC contexts. As a fix, we just clone it if it's equal
between copy sides.

Reported-by: Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>

No differences found