File gnutls-3.6.7-fips-backport_dont_truncate_output_IV.patch of Package gnutls.18748

Index: gnutls-3.6.7/lib/nettle/backport/cfb8.c
===================================================================
--- gnutls-3.6.7.orig/lib/nettle/backport/cfb8.c
+++ gnutls-3.6.7/lib/nettle/backport/cfb8.c
@@ -106,10 +106,12 @@ cfb8_decrypt(const void *ctx, nettle_cip
       src += i;
       dst += i;
 
-      memcpy(buffer, buffer + block_size, block_size);
-      memcpy(buffer + block_size, src,
-	     length < block_size ? length : block_size);
-
+      if (i == block_size)
+	{
+	  memcpy(buffer, buffer + block_size, block_size);
+	  memcpy(buffer + block_size, src,
+		 length < block_size ? length : block_size);
+	}
     }
 
   memcpy(iv, buffer + i, block_size);
openSUSE Build Service is sponsored by