libgcrypt: upgraded package to upstream

Upgraded dev-libs/libgcrypt to version 1.9.4 on amd64, arm64

BUG=b/200139111
TEST=presubmit
RELEASE_NOTE=Upgraded libgcrypt to 1.9.4. This fixes CVE-2021-40528

cos-patch: lts-refresh
Change-Id: I8d72c0491478cf3559eda388c9e98903aca834f3
Reviewed-on: https://cos-review.googlesource.com/c/third_party/overlays/portage-stable/+/24051
Reviewed-by: Varsha Teratipally <teratipally@google.com>
Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
Main-Branch-Verified: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/dev-libs/libgcrypt/Manifest b/dev-libs/libgcrypt/Manifest
index f95729b..edf3509 100644
--- a/dev-libs/libgcrypt/Manifest
+++ b/dev-libs/libgcrypt/Manifest
@@ -1 +1 @@
-DIST libgcrypt-1.9.3.tar.bz2 3219061 BLAKE2B 51a6273ba28829c016d9a93fffa181aec24170d0e4d3a363c788f336219e1531274344adeea289f3cc09161fdb2e56846551367a8ac880b14e03a52ab0dd551a SHA512 977e766887c14f19aa1b9fcc0214303036a649e41cd4278de76da7d734cf36888e2e1b6275590dac523dcb4ba8ab07993e6ee8209fd5f1a3383d738b09a060d6
+DIST libgcrypt-1.9.4.tar.bz2 3239704 BLAKE2B b8244bc12a68955797b0c2b474ac5c95df1014231f7180a2ffa113e3aacedc98eed60ee1e4b30b032a5fcd6a04855ae07142c223906d5db9c28328a71e014f33 SHA512 d0e117ac73c94d70e9521ee1e6328691498cc8328f8c4e21338096908f5c04c7b838966eb63d59494565f4e19f506c07dab4f4d922150d75610d9f7b57abbf60
diff --git a/dev-libs/libgcrypt/files/libgcrypt-1.6.1-uscore.patch b/dev-libs/libgcrypt/files/libgcrypt-1.6.1-uscore.patch
deleted file mode 100644
index 22bfac3..0000000
--- a/dev-libs/libgcrypt/files/libgcrypt-1.6.1-uscore.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-The version taken from GnuPG 1.4 assumes any cross-compiled package have
-prefixed underscores, which is not the case; by using libtool's own macro,
-we can avoid the whole issue.
-
---- libgcrypt-1.6.1/configure.ac
-+++ libgcrypt-1.6.1/configure.ac
-@@ -1022,7 +1022,7 @@
- # Check whether underscores in symbols are required.  This needs to be
- # done before setting up the assembler stuff.
- #
--GNUPG_SYS_SYMBOL_UNDERSCORE()
-+LT_SYS_SYMBOL_USCORE
- 
- 
- #################################
---- libgcrypt-1.6.1/mpi/config.links
-+++ libgcrypt-1.6.1/mpi/config.links
-@@ -362,7 +362,7 @@
- 
- # Make sysdep.h
- echo '/* created by config.links - do not edit */' >./mpi/sysdep.h
--if test x$ac_cv_sys_symbol_underscore = xyes; then
-+if test x$sys_symbol_underscore = xyes; then
-     cat <<EOF >>./mpi/sysdep.h
- #if __STDC__
- #define C_SYMBOL_NAME(name) _##name
diff --git a/dev-libs/libgcrypt/files/libgcrypt-1.9.1-fix-no-asm-on-amd64-x86.patch b/dev-libs/libgcrypt/files/libgcrypt-1.9.1-fix-no-asm-on-amd64-x86.patch
deleted file mode 100644
index 875c223..0000000
--- a/dev-libs/libgcrypt/files/libgcrypt-1.9.1-fix-no-asm-on-amd64-x86.patch
+++ /dev/null
@@ -1,141 +0,0 @@
-Broken in https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commitdiff;h=8d404a629167d67ed56e45de3e65d1e0b7cdeb24;hp=3b34bd6e178614d6021ee7d1140646f7c8ed7519
-https://dev.gnupg.org/T5277
-https://bugs.gentoo.org/767859
-
-This is a revert of that commit, as suggested by upstream in the linked bug.
-diff --git a/random/rand-internal.h b/random/rand-internal.h
-index 34221569..d99c6671 100644
---- a/random/rand-internal.h
-+++ b/random/rand-internal.h
-@@ -141,7 +141,7 @@ void _gcry_rndhw_poll_fast (void (*add)(const void*, size_t,
-                             enum random_origins origin);
- size_t _gcry_rndhw_poll_slow (void (*add)(const void*, size_t,
-                                           enum random_origins),
--                              enum random_origins origin, size_t req_length);
-+                              enum random_origins origin);
- 
- 
- 
-diff --git a/random/rndhw.c b/random/rndhw.c
-index 3cf9acc3..2829382c 100644
---- a/random/rndhw.c
-+++ b/random/rndhw.c
-@@ -198,33 +198,24 @@ _gcry_rndhw_poll_fast (void (*add)(const void*, size_t, enum random_origins),
- 
- 
- /* Read 64 bytes from a hardware RNG and return the number of bytes
--   actually read.  However hardware source is let account only
--   for up to 50% (or 25% for RDRAND) of the requested bytes.  */
-+   actually read.  */
- size_t
- _gcry_rndhw_poll_slow (void (*add)(const void*, size_t, enum random_origins),
--                       enum random_origins origin, size_t req_length)
-+                       enum random_origins origin)
- {
-   size_t nbytes = 0;
- 
-   (void)add;
-   (void)origin;
- 
--  req_length /= 2; /* Up to 50%. */
--
- #ifdef USE_DRNG
-   if ((_gcry_get_hw_features () & HWF_INTEL_RDRAND))
--    {
--      req_length /= 2; /* Up to 25%. */
--      nbytes += poll_drng (add, origin, 0);
--    }
-+    nbytes += poll_drng (add, origin, 0);
- #endif
- #ifdef USE_PADLOCK
-   if ((_gcry_get_hw_features () & HWF_PADLOCK_RNG))
-     nbytes += poll_padlock (add, origin, 0);
- #endif
- 
--  if (nbytes > req_length)
--    nbytes = req_length;
--
-   return nbytes;
- }
-diff --git a/random/rndlinux.c b/random/rndlinux.c
-index a22db177..f378a549 100644
---- a/random/rndlinux.c
-+++ b/random/rndlinux.c
-@@ -190,10 +190,19 @@ _gcry_rndlinux_gather_random (void (*add)(const void*, size_t,
-     }
- 
- 
--  /* First read from a hardware source.  Note that _gcry_rndhw_poll_slow lets
--     it account only for up to 50% (or 25% for RDRAND) of the requested
--     bytes.  */
--  n_hw = _gcry_rndhw_poll_slow (add, origin, length);
-+  /* First read from a hardware source.  However let it account only
-+     for up to 50% (or 25% for RDRAND) of the requested bytes.  */
-+  n_hw = _gcry_rndhw_poll_slow (add, origin);
-+  if ((_gcry_get_hw_features () & HWF_INTEL_RDRAND))
-+    {
-+      if (n_hw > length/4)
-+        n_hw = length/4;
-+    }
-+  else
-+    {
-+      if (n_hw > length/2)
-+        n_hw = length/2;
-+    }
-   if (length > 1)
-     length -= n_hw;
- 
-diff --git a/src/g10lib.h b/src/g10lib.h
-index 243997eb..cba2e237 100644
---- a/src/g10lib.h
-+++ b/src/g10lib.h
-@@ -217,8 +217,6 @@ char **_gcry_strtokenize (const char *string, const char *delim);
- 
- 
- /*-- src/hwfeatures.c --*/
--#if defined(HAVE_CPU_ARCH_X86)
--
- #define HWF_PADLOCK_RNG         (1 << 0)
- #define HWF_PADLOCK_AES         (1 << 1)
- #define HWF_PADLOCK_SHA         (1 << 2)
-@@ -238,28 +236,20 @@ char **_gcry_strtokenize (const char *string, const char *delim);
- #define HWF_INTEL_RDTSC         (1 << 15)
- #define HWF_INTEL_SHAEXT        (1 << 16)
- 
--#elif defined(HAVE_CPU_ARCH_ARM)
--
--#define HWF_ARM_NEON            (1 << 0)
--#define HWF_ARM_AES             (1 << 1)
--#define HWF_ARM_SHA1            (1 << 2)
--#define HWF_ARM_SHA2            (1 << 3)
--#define HWF_ARM_PMULL           (1 << 4)
--
--#elif defined(HAVE_CPU_ARCH_PPC)
-+#define HWF_ARM_NEON            (1 << 17)
-+#define HWF_ARM_AES             (1 << 18)
-+#define HWF_ARM_SHA1            (1 << 19)
-+#define HWF_ARM_SHA2            (1 << 20)
-+#define HWF_ARM_PMULL           (1 << 21)
- 
--#define HWF_PPC_VCRYPTO         (1 << 0)
--#define HWF_PPC_ARCH_3_00       (1 << 1)
--#define HWF_PPC_ARCH_2_07       (1 << 2)
-+#define HWF_PPC_VCRYPTO         (1 << 22)
-+#define HWF_PPC_ARCH_3_00       (1 << 23)
-+#define HWF_PPC_ARCH_2_07       (1 << 24)
- 
--#elif defined(HAVE_CPU_ARCH_S390X)
--
--#define HWF_S390X_MSA           (1 << 0)
--#define HWF_S390X_MSA_4         (1 << 1)
--#define HWF_S390X_MSA_8         (1 << 2)
--#define HWF_S390X_VX            (1 << 3)
--
--#endif
-+#define HWF_S390X_MSA           (1 << 25)
-+#define HWF_S390X_MSA_4         (1 << 26)
-+#define HWF_S390X_MSA_8         (1 << 27)
-+#define HWF_S390X_VX            (1 << 28)
- 
- gpg_err_code_t _gcry_disable_hw_feature (const char *name);
- void _gcry_detect_hw_features (void);
diff --git a/dev-libs/libgcrypt/libgcrypt-1.9.3.ebuild b/dev-libs/libgcrypt/libgcrypt-1.9.4.ebuild
similarity index 100%
rename from dev-libs/libgcrypt/libgcrypt-1.9.3.ebuild
rename to dev-libs/libgcrypt/libgcrypt-1.9.4.ebuild