X-Git-Url: http://wagner.pp.ru/gitweb/?a=blobdiff_plain;f=gost_crypt.c;h=213b285bad436544431ac62207083306a4a630d0;hb=4dc691d1177ad328f34bee01128b3a8aa23b2547;hp=feca0b6e2ec030361b6aed90ce8de25f4b67c873;hpb=6036eb9be5403af769f211b1056d34bf65028aea;p=openssl-gost%2Fengine.git diff --git a/gost_crypt.c b/gost_crypt.c index feca0b6..213b285 100644 --- a/gost_crypt.c +++ b/gost_crypt.c @@ -575,11 +575,13 @@ static int gost_cipher_do_cbc(EVP_CIPHER_CTX *ctx, unsigned char *out, } } else { while (inl > 0) { + unsigned char tmpiv[8]; gostdecrypt(&(c->cctx), in_ptr, b); + memcpy(tmpiv, in_ptr, 8); for (i = 0; i < 8; i++) { out_ptr[i] = iv[i] ^ b[i]; } - memcpy(iv, in_ptr, 8); + memcpy(iv, tmpiv, 8); out_ptr += 8; in_ptr += 8; inl -= 8;