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

index 44f4e49..4977d1d 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];