The function EVP_CIPHER_get_asn1_iv(), which is the default
get_asn1_params implementation, can be used to set the "original IV".
No need to reach into the inside of EVP_CIPHER_CTX, which makes it
much more future proof.
GOST_CIPHER_PARAMS_free(gcp);
return -1;
}
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);
GOST_CIPHER_PARAMS_free(gcp);