X-Git-Url: http://www.wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_omac.c;fp=gost_omac.c;h=e78fd9d7c5de76e3e7b00c80e7a18a1e5b26eeb9;hb=e0816ed2014bad0e5293cafcce2c07a66a4f1cb0;hp=d1f897a15c2227b8936e51625eeb73f818b433a3;hpb=10ae275fd54e600c08ee330eaf9738aa476e0ca4;p=openssl-gost%2Fengine.git diff --git a/gost_omac.c b/gost_omac.c index d1f897a..e78fd9d 100644 --- a/gost_omac.c +++ b/gost_omac.c @@ -92,6 +92,13 @@ int omac_imit_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) { return 0; } + if (!c_from->cmac_ctx) { + if (c_to->cmac_ctx) { + CMAC_CTX_free(c_to->cmac_ctx); + c_to->cmac_ctx = NULL; + } + return 1; + } if (c_to->cmac_ctx == c_from->cmac_ctx) { c_to->cmac_ctx = CMAC_CTX_new();