aboutsummaryrefslogtreecommitdiffstats
path: root/g10/free-packet.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2024-09-03 15:29:28 +0000
committerWerner Koch <[email protected]>2024-09-06 14:09:49 +0000
commit1e2515726676b05ddae37f2306806928870fd12a (patch)
tree0ebd3b16b3f9a4cbdfdf053685810ad7493b7297 /g10/free-packet.c
parentscd:w32: Fix for setting an environment block with GNUPGHOME. (diff)
downloadgnupg-1e2515726676b05ddae37f2306806928870fd12a.tar.gz
gnupg-1e2515726676b05ddae37f2306806928870fd12a.zip
gpg: remove workaround for Libgcrypt < 1.8.6
* g10/free-packet.c (is_mpi_copy_broken): Remove.
Diffstat (limited to 'g10/free-packet.c')
-rw-r--r--g10/free-packet.c33
1 files changed, 4 insertions, 29 deletions
diff --git a/g10/free-packet.c b/g10/free-packet.c
index b0642043e..a80bc7b04 100644
--- a/g10/free-packet.c
+++ b/g10/free-packet.c
@@ -30,24 +30,10 @@
#include "options.h"
-/* Run time check to see whether mpi_copy does not copy the flags
- * properly. This was fixed in version 1.8.6. */
-static int
-is_mpi_copy_broken (void)
-{
- static char result;
-
- if (!result)
- {
- result = !gcry_check_version ("1.8.6");
- result |= 0x80;
- }
- return (result & 1);
-}
-
-
-/* This is mpi_copy with a fix for opaque MPIs which store a NULL
- pointer. This will also be fixed in Libggcrypt 1.7.0. */
+/* This is a wrapper for mpi_copy which handles opaque MPIs with a
+ * NULL pointer as opaque data; e.g. gcry_mpi_set_opaque(a, NULL, 0).
+ * It seems that at least gcry_mpi_set_opaque_copy does not yet handle
+ * this correctly. */
static gcry_mpi_t
my_mpi_copy (gcry_mpi_t a)
{
@@ -56,17 +42,6 @@ my_mpi_copy (gcry_mpi_t a)
&& !gcry_mpi_get_opaque (a, NULL))
return NULL;
- if (is_mpi_copy_broken ())
- {
- int flag_user2 = a? gcry_mpi_get_flag (a, GCRYMPI_FLAG_USER2) : 0;
- gcry_mpi_t b;
-
- b = gcry_mpi_copy (a);
- if (b && flag_user2)
- gcry_mpi_set_flag (b, GCRYMPI_FLAG_USER2);
- return b;
- }
-
return gcry_mpi_copy (a);
}