]> www.wagner.pp.ru Git - openssl-gost/engine.git/commit
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)
commit636dd0c1f36872f0abcb4f8a465e837929ed19d1
treee0332f14b008b6eacfce8b2c83e38d94d4d02c01
parentae390d45207aadb69eb96d8c11c1ee888f70815f
Fix EVP_MD_CTX_copy_ex for OMAC

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>
gost_omac.c