]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - gost_crypt.c
Get ASN.1 IV using public functions
[openssl-gost/engine.git] / gost_crypt.c
index 259939dde80814ad86588f0c406a0da9a5690ca3..8132a1eaaffee8b3e899bbae60b362dc5d221113 100644 (file)
@@ -649,7 +649,12 @@ int gost89_get_asn1_parameters(EVP_CIPHER_CTX *ctx, ASN1_TYPE *params)
         GOST_CIPHER_PARAMS_free(gcp);
         return -1;
     }
-    memcpy(ctx->oiv, gcp->iv->data, len);
+
+    {
+        ASN1_TYPE tmp;
+        ASN1_TYPE_set(&tmp, V_ASN1_OCTET_STRING, gcp->iv);
+        EVP_CIPHER_get_asn1_iv(ctx, &tmp);
+    }
 
     GOST_CIPHER_PARAMS_free(gcp);