patch-lib_libgcrypt-grub_cipher_rijndael_c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. --- grub-1.98.orig/lib/libgcrypt-grub/cipher/rijndael.c 2010-03-06 21:52:26.000000000 +0100
  2. +++ grub-1.98/lib/libgcrypt-grub/cipher/rijndael.c 2010-06-26 20:23:29.463277513 +0200
  3. @@ -139,7 +139,7 @@ do_setkey (RIJNDAEL_context *ctx, const
  4. if ((_gcry_get_hw_features () & HWF_PADLOCK_AES))
  5. {
  6. ctx->use_padlock = 1;
  7. - memcpy (ctx->padlock_key, key, keylen);
  8. + grub_memcpy (ctx->padlock_key, key, keylen);
  9. }
  10. #endif
  11. }
  12. @@ -411,9 +411,9 @@ do_encrypt (const RIJNDAEL_context *ctx,
  13. byte b[16];
  14. } b;
  15. - memcpy (a.a, ax, 16);
  16. + grub_memcpy (a.a, ax, 16);
  17. do_encrypt_aligned (ctx, b.b, a.a);
  18. - memcpy (bx, b.b, 16);
  19. + grub_memcpy (bx, b.b, 16);
  20. }
  21. @@ -440,7 +440,7 @@ do_padlock (const RIJNDAEL_context *ctx,
  22. if (decrypt_flag)
  23. cword[0] |= 0x00000200;
  24. - memcpy (a, ax, 16);
  25. + grub_memcpy (a, ax, 16);
  26. asm volatile
  27. ("pushfl\n\t" /* Force key reload. */
  28. @@ -454,7 +454,7 @@ do_padlock (const RIJNDAEL_context *ctx,
  29. : "%ecx", "cc", "memory"
  30. );
  31. - memcpy (bx, b, 16);
  32. + grub_memcpy (bx, b, 16);
  33. }
  34. #endif /*USE_PADLOCK*/
  35. @@ -609,9 +609,9 @@ do_decrypt (RIJNDAEL_context *ctx, byte
  36. ctx->decryption_prepared = 1;
  37. }
  38. - memcpy (a.a, ax, 16);
  39. + grub_memcpy (a.a, ax, 16);
  40. do_decrypt_aligned (ctx, b.b, a.a);
  41. - memcpy (bx, b.b, 16);
  42. + grub_memcpy (bx, b.b, 16);
  43. #undef rk
  44. }