openssl-1.1.1d-reenable-the-stitched-AES-CBC-HMAC-SHA-implementations.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. From 61cc715240d2d3f9511ca88043a3e9797c11482f Mon Sep 17 00:00:00 2001
  2. From: Richard Levitte <levitte@openssl.org>
  3. Date: Thu, 3 Oct 2019 08:28:31 +0200
  4. Subject: [PATCH] Define AESNI_ASM if AESNI assembler is included, and use it
  5. Because we have cases where basic assembler support isn't present, but
  6. AESNI asssembler support is, we need a separate macro that indicates
  7. that, and use it.
  8. Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
  9. Reviewed-by: Paul Dale <paul.dale@oracle.com>
  10. (Merged from https://github.com/openssl/openssl/pull/10080)
  11. ---
  12. Configure | 1 +
  13. crypto/evp/e_aes_cbc_hmac_sha1.c | 2 +-
  14. crypto/evp/e_aes_cbc_hmac_sha256.c | 4 ++--
  15. 3 files changed, 4 insertions(+), 3 deletions(-)
  16. diff --git a/Configure b/Configure
  17. index 811bee81f54..f498ac2f81b 100755
  18. --- a/Configure
  19. +++ b/Configure
  20. @@ -1376,6 +1376,7 @@ unless ($disabled{asm}) {
  21. }
  22. if ($target{aes_asm_src}) {
  23. push @{$config{lib_defines}}, "AES_ASM" if ($target{aes_asm_src} =~ m/\baes-/);;
  24. + push @{$config{lib_defines}}, "AESNI_ASM" if ($target{aes_asm_src} =~ m/\baesni-/);;
  25. # aes-ctr.fake is not a real file, only indication that assembler
  26. # module implements AES_ctr32_encrypt...
  27. push @{$config{lib_defines}}, "AES_CTR_ASM" if ($target{aes_asm_src} =~ s/\s*aes-ctr\.fake//);
  28. diff --git a/crypto/evp/e_aes_cbc_hmac_sha1.c b/crypto/evp/e_aes_cbc_hmac_sha1.c
  29. index c9f5969162c..27c36b46e7a 100644
  30. --- a/crypto/evp/e_aes_cbc_hmac_sha1.c
  31. +++ b/crypto/evp/e_aes_cbc_hmac_sha1.c
  32. @@ -33,7 +33,7 @@ typedef struct {
  33. #define NO_PAYLOAD_LENGTH ((size_t)-1)
  34. -#if defined(AES_ASM) && ( \
  35. +#if defined(AESNI_ASM) && ( \
  36. defined(__x86_64) || defined(__x86_64__) || \
  37. defined(_M_AMD64) || defined(_M_X64) )
  38. diff --git a/crypto/evp/e_aes_cbc_hmac_sha256.c b/crypto/evp/e_aes_cbc_hmac_sha256.c
  39. index d5178313ae3..cc622b6faa8 100644
  40. --- a/crypto/evp/e_aes_cbc_hmac_sha256.c
  41. +++ b/crypto/evp/e_aes_cbc_hmac_sha256.c
  42. @@ -34,7 +34,7 @@ typedef struct {
  43. # define NO_PAYLOAD_LENGTH ((size_t)-1)
  44. -#if defined(AES_ASM) && ( \
  45. +#if defined(AESNI_ASM) && ( \
  46. defined(__x86_64) || defined(__x86_64__) || \
  47. defined(_M_AMD64) || defined(_M_X64) )
  48. @@ -947,4 +947,4 @@ const EVP_CIPHER *EVP_aes_256_cbc_hmac_sha256(void)
  49. {
  50. return NULL;
  51. }
  52. -#endif
  53. +#endif /* AESNI_ASM */