fix bug in ccgost CFB mode code
authorDr. Stephen Henson <steve@openssl.org>
Wed, 14 Apr 2010 00:33:22 +0000 (00:33 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 14 Apr 2010 00:33:22 +0000 (00:33 +0000)
engines/ccgost/gost_crypt.c

index 44f4e49bc98014cf8ccc90b26bcacd4e77d7e1cc..4977d1dcf5036a39d828aea0bbc6564b1e03a18a 100644 (file)
@@ -299,7 +299,7 @@ int gost_cipher_do_cfb(EVP_CIPHER_CTX *ctx, unsigned char *out,
        if (i<inl)
                {
                gost_crypt_mesh(ctx->cipher_data,ctx->iv,ctx->buf);
-               if (!ctx->encrypt) memcpy(ctx->buf+8,in_ptr,j);
+               if (!ctx->encrypt) memcpy(ctx->buf+8,in_ptr,inl-i);
                for (j=0;i<inl;j++,i++)
                        {
                        out_ptr[j]=ctx->buf[j]^in_ptr[j];