]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_omac_acpkm.c
Ensure that CMAC_ACPKM_CTX_copy works with 2 non-NULL pointers.
[openssl-gost/engine.git] / gost_omac_acpkm.c
index cec683fb34637a393fa09049f490cd3c78eafa89..507ca53532d5684be92117679908bcfd6b9047b0 100644 (file)
@@ -372,7 +372,7 @@ static int omac_acpkm_imit_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from)
         }
         return 1;
     }
-    if (c_to->cmac_ctx == c_from->cmac_ctx) {
+    if ((c_to->cmac_ctx == c_from->cmac_ctx) || (c_to->cmac_ctx == NULL))  {
         c_to->cmac_ctx = CMAC_ACPKM_CTX_new();
     }
     return CMAC_ACPKM_CTX_copy(c_to->cmac_ctx, c_from->cmac_ctx);