1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-03 12:11:33 +01:00

gpg:card: Remove the code for GnuPG version 1.

* g10/card-util.c [GNUPG_MAJOR_VERSION == 1] (get_data_from_file):
Remove the old code.
(put_data_to_file): Likewise.

--

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2023-07-05 09:24:40 +09:00
parent 334f5d95c8
commit 2c5a93e66e
No known key found for this signature in database
GPG Key ID: 640114AF89DE6054

View File

@ -28,9 +28,7 @@
# include <readline/readline.h> # include <readline/readline.h>
#endif /*HAVE_LIBREADLINE*/ #endif /*HAVE_LIBREADLINE*/
#if GNUPG_MAJOR_VERSION != 1
# include "gpg.h" # include "gpg.h"
#endif /*GNUPG_MAJOR_VERSION != 1*/
#include "../common/util.h" #include "../common/util.h"
#include "../common/i18n.h" #include "../common/i18n.h"
#include "../common/ttyio.h" #include "../common/ttyio.h"
@ -39,11 +37,7 @@
#include "main.h" #include "main.h"
#include "keyserver-internal.h" #include "keyserver-internal.h"
#if GNUPG_MAJOR_VERSION == 1 #include "call-agent.h"
# include "cardglue.h"
#else /*GNUPG_MAJOR_VERSION!=1*/
# include "call-agent.h"
#endif /*GNUPG_MAJOR_VERSION!=1*/
#define CONTROL_D ('D' - 'A' + 1) #define CONTROL_D ('D' - 'A' + 1)
@ -942,14 +936,6 @@ get_data_from_file (const char *fname, char **r_buffer)
*r_buffer = NULL; *r_buffer = NULL;
fp = es_fopen (fname, "rb"); fp = es_fopen (fname, "rb");
#if GNUPG_MAJOR_VERSION == 1
if (fp && is_secured_file (fileno (fp)))
{
fclose (fp);
fp = NULL;
errno = EPERM;
}
#endif
if (!fp) if (!fp)
{ {
tty_printf (_("can't open '%s': %s\n"), fname, strerror (errno)); tty_printf (_("can't open '%s': %s\n"), fname, strerror (errno));
@ -985,14 +971,6 @@ put_data_to_file (const char *fname, const void *buffer, size_t length)
estream_t fp; estream_t fp;
fp = es_fopen (fname, "wb"); fp = es_fopen (fname, "wb");
#if GNUPG_MAJOR_VERSION == 1
if (fp && is_secured_file (fileno (fp)))
{
fclose (fp);
fp = NULL;
errno = EPERM;
}
#endif
if (!fp) if (!fp)
{ {
tty_printf (_("can't create '%s': %s\n"), fname, strerror (errno)); tty_printf (_("can't create '%s': %s\n"), fname, strerror (errno));