From 28de5c0ea53373c56a4405fe6b08d194682dd1de Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 25 Feb 2019 09:28:22 +0100 Subject: [PATCH] card: Rename gpg-card-tool to gpg-card. * tools/card-tool-keys.c: Rename to card-keys.c. * tools/card-tool-misc.c: Rename to card-misc.c. * tools/card-tool-yubikey.c: Rename to card-yubikey.c. * tools/card-tool.h: Rename to gpg-card.h. * tools/gpg-card-tool-w32info.rc: Rename to gpg-card-w32info.rc * doc/card-tool.texi: Rename top gpg-card.texi Signed-off-by: Werner Koch --- doc/Makefile.am | 6 ++-- doc/gnupg.texi | 2 +- doc/{card-tool.texi => gpg-card.texi} | 20 ++++++------- po/POTFILES.in | 5 +++- tools/Makefile.am | 29 ++++++++++--------- tools/card-call-scd.c | 2 +- tools/{card-tool-keys.c => card-keys.c} | 7 +++-- tools/{card-tool-misc.c => card-misc.c} | 4 +-- tools/{card-tool-yubikey.c => card-yubikey.c} | 4 +-- ...rd-tool-w32info.rc => gpg-card-w32info.rc} | 6 ++-- tools/{gpg-card-tool.c => gpg-card.c} | 16 +++++----- tools/{card-tool.h => gpg-card.h} | 14 ++++----- 12 files changed, 61 insertions(+), 54 deletions(-) rename doc/{card-tool.texi => gpg-card.texi} (87%) rename tools/{card-tool-keys.c => card-keys.c} (99%) rename tools/{card-tool-misc.c => card-misc.c} (97%) rename tools/{card-tool-yubikey.c => card-yubikey.c} (99%) rename tools/{gpg-card-tool-w32info.rc => gpg-card-w32info.rc} (89%) rename tools/{gpg-card-tool.c => gpg-card.c} (99%) rename tools/{card-tool.h => gpg-card.h} (97%) diff --git a/doc/Makefile.am b/doc/Makefile.am index 19b3825b1..0720dd366 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -69,7 +69,7 @@ nobase_dist_doc_DATA = FAQ DETAILS HACKING DCO TRANSLATE OpenPGP KEYSERVER \ gnupg_TEXINFOS = \ gpg.texi gpgsm.texi gpg-agent.texi scdaemon.texi instguide.texi \ tools.texi debugging.texi glossary.texi contrib.texi gpl.texi \ - sysnotes.texi dirmngr.texi wks.texi card-tool.texi \ + sysnotes.texi dirmngr.texi wks.texi gpg-card.texi \ gnupg-module-overview.svg \ gnupg-card-architecture.fig \ howtos.texi howto-create-a-server-cert.texi @@ -90,12 +90,12 @@ YAT2M_OPTIONS = -I $(srcdir) \ myman_sources = gnupg7.texi gpg.texi gpgsm.texi gpg-agent.texi \ dirmngr.texi scdaemon.texi tools.texi wks.texi \ - card-tool.texi + gpg-card.texi myman_pages = gpgsm.1 gpg-agent.1 dirmngr.8 scdaemon.1 \ watchgnupg.1 gpgconf.1 addgnupghome.8 gpg-preset-passphrase.1 \ gpg-connect-agent.1 gpgparsemail.1 symcryptrun.1 gpgtar.1 \ applygnupgdefaults.8 gpg-wks-client.1 gpg-wks-server.1 \ - dirmngr-client.1 gpg-card-tool.1 + dirmngr-client.1 gpg-card.1 if USE_GPG2_HACK myman_pages += gpg2.1 gpgv2.1 else diff --git a/doc/gnupg.texi b/doc/gnupg.texi index 6210486a0..78d4669da 100644 --- a/doc/gnupg.texi +++ b/doc/gnupg.texi @@ -187,7 +187,7 @@ the administration and the architecture. @cindex trust values @include trust-values.texi -@include card-tool.texi +@include gpg-card.texi @include tools.texi @include wks.texi diff --git a/doc/card-tool.texi b/doc/gpg-card.texi similarity index 87% rename from doc/card-tool.texi rename to doc/gpg-card.texi index b84f20721..92bc12362 100644 --- a/doc/card-tool.texi +++ b/doc/gpg-card.texi @@ -13,26 +13,26 @@ tool is an extension of the @option{--edit-key} command available with @command{gpg}. @menu -* gpg-card-tool:: Administrate smart cards. +* gpg-card:: Administrate smart cards. @end menu @c @c GPG-CARD-TOOL @c -@manpage gpg-card-tool.1 -@node gpg-card-tool +@manpage gpg-card.1 +@node gpg-card @section Administrate smart cards. @ifset manverb -.B gpg-card-tool +.B gpg-card \- Administrate Smart Cards @end ifset @mansect synopsis @ifset manverb -.B gpg-card-tool +.B gpg-card .RI [ options ] .br -.B gpg-card-tool +.B gpg-card .RI [ options ] .I command .RI { @@ -42,16 +42,16 @@ tool is an extension of the @option{--edit-key} command available with @end ifset @mansect description -The @command{gpg-card-tool} is used to administrate smart cards and USB +The @command{gpg-card} is used to administrate smart cards and USB tokens. It provides a superset of features from @command{gpg --card-edit} an can be considered a frontend to @command{scdaemon} which is a daemon started by @command{gpg-agent} to handle smart cards. -If @command{gpg-card-tool} is invoked without commands an interactive +If @command{gpg-card} is invoked without commands an interactive mode is used. -If @command{gpg-card-tool} is invoked with one or more commands the +If @command{gpg-card} is invoked with one or more commands the same commands as available in the interactive mode are run from the command line. These commands need to be delimited with a double-dash. If a double-dash or a shell specific character is required as part of @@ -66,7 +66,7 @@ COMMAND}. @mansect options @noindent -@command{gpg-card-tool} understands these options: +@command{gpg-card} understands these options: @table @gnupgtabopt diff --git a/po/POTFILES.in b/po/POTFILES.in index 53a7dc8a5..da5581168 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -127,5 +127,8 @@ tools/gpgconf.c tools/no-libgcrypt.c tools/symcryptrun.c tools/gpg-check-pattern.c -tools/gpg-card-tool.c +tools/gpg-card.c +tools/card-misc.c +tools/card-keys.c +tools/card-yubikey.c tools/card-call-scd.c diff --git a/tools/Makefile.am b/tools/Makefile.am index 69f4098ca..fb37c05e7 100644 --- a/tools/Makefile.am +++ b/tools/Makefile.am @@ -22,14 +22,14 @@ EXTRA_DIST = \ lspgpot mail-signed-keys convert-from-106 sockprox.c \ ccidmon.c ChangeLog-2011 \ gpg-connect-agent-w32info.rc \ - gpg-card-tool-w32info.rc + gpg-card-w32info.rc AM_CPPFLAGS = include $(top_srcdir)/am/cmacros.am if HAVE_W32_SYSTEM gpg_connect_agent_rc_objs = gpg-connect-agent-w32info.o -gpg_card_tool_rc_objs = gpg-card-tool-w32info.o +gpg_card_tool_rc_objs = gpg-card-w32info.o resource_objs += $(gpg_connect_agent_rc_objs) $(gpg_card_tool_rc_objs) endif @@ -51,7 +51,7 @@ endif libexec_PROGRAMS = gpg-wks-client gpg-pair-tool -bin_PROGRAMS = gpgconf gpg-connect-agent gpg-card-tool ${symcryptrun} +bin_PROGRAMS = gpgconf gpg-connect-agent gpg-card ${symcryptrun} if !HAVE_W32_SYSTEM bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server} endif @@ -124,19 +124,20 @@ gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \ $(gpg_connect_agent_rc_objs) -gpg_card_tool_SOURCES = \ - gpg-card-tool.c \ - card-tool.h \ +gpg_card_SOURCES = \ + gpg-card.c \ + gpg-card.h \ card-call-scd.c \ - card-tool-keys.c \ - card-tool-yubikey.c \ - card-tool-misc.c + card-keys.c \ + card-yubikey.c \ + card-misc.c -gpg_card_tool_LDADD = ../common/libgpgrl.a $(common_libs) \ - $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \ - $(GPG_ERROR_LIBS) \ - $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \ - $(gpg_card_tool_rc_objs) +gpg_card_LDADD = \ + ../common/libgpgrl.a $(common_libs) \ + $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \ + $(GPG_ERROR_LIBS) \ + $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \ + $(gpg_card_tool_rc_objs) if !DISABLE_REGEX diff --git a/tools/card-call-scd.c b/tools/card-call-scd.c index 83e9ba099..55ecf126e 100644 --- a/tools/card-call-scd.c +++ b/tools/card-call-scd.c @@ -39,7 +39,7 @@ #include "../common/status.h" #include "../common/host2net.h" #include "../common/openpgpdefs.h" -#include "card-tool.h" +#include "gpg-card.h" #define CONTROL_D ('D' - 'A' + 1) diff --git a/tools/card-tool-keys.c b/tools/card-keys.c similarity index 99% rename from tools/card-tool-keys.c rename to tools/card-keys.c index 4e057ad94..ad06f2ff7 100644 --- a/tools/card-tool-keys.c +++ b/tools/card-keys.c @@ -1,4 +1,4 @@ -/* card-tool-keys.c - OpenPGP and CMS related functions for gpg-card-tool +/* card-keys.c - OpenPGP and CMS related functions for gpg-card * Copyright (C) 2019 g10 Code GmbH * * This file is part of GnuPG. @@ -28,7 +28,7 @@ #include "../common/ccparray.h" #include "../common/exectool.h" #include "../common/openpgpdefs.h" -#include "card-tool.h" +#include "gpg-card.h" /* It is quite common that all keys of an OpenPGP card belong to the @@ -168,6 +168,9 @@ parse_key_record (char **fields, int nfields, pubkey_t *r_pubkey) { pubkey_t pubkey; + (void)fields; /* Not yet used. */ + (void)nfields; + pubkey = xtrycalloc (1, sizeof *pubkey); if (!pubkey) return gpg_error_from_syserror (); diff --git a/tools/card-tool-misc.c b/tools/card-misc.c similarity index 97% rename from tools/card-tool-misc.c rename to tools/card-misc.c index d0fb55dab..bccdbda9d 100644 --- a/tools/card-tool-misc.c +++ b/tools/card-misc.c @@ -1,4 +1,4 @@ -/* card-tool-misc.c - Helper functions for gpg-card-tool +/* card-misc.c - Helper functions for gpg-card * Copyright (C) 2019 g10 Code GmbH * * This file is part of GnuPG. @@ -28,7 +28,7 @@ #include "../common/util.h" #include "../common/i18n.h" #include "../common/openpgpdefs.h" -#include "card-tool.h" +#include "gpg-card.h" /* Return the key info object for the key KEYREF. If it is not found * NULL is returned. */ diff --git a/tools/card-tool-yubikey.c b/tools/card-yubikey.c similarity index 99% rename from tools/card-tool-yubikey.c rename to tools/card-yubikey.c index 996bbf041..f9d130988 100644 --- a/tools/card-tool-yubikey.c +++ b/tools/card-yubikey.c @@ -1,4 +1,4 @@ -/* card-tool-yubikey.c - Yubikey specific functions. +/* card-yubikey.c - Yubikey specific functions. * Copyright (C) 2019 g10 Code GmbH * * This file is part of GnuPG. @@ -29,7 +29,7 @@ #include "../common/i18n.h" #include "../common/tlv.h" #include "../common/ttyio.h" -#include "card-tool.h" +#include "gpg-card.h" /* Object to describe requested interface options. */ diff --git a/tools/gpg-card-tool-w32info.rc b/tools/gpg-card-w32info.rc similarity index 89% rename from tools/gpg-card-tool-w32info.rc rename to tools/gpg-card-w32info.rc index 6937c3e34..b35ff4ce2 100644 --- a/tools/gpg-card-tool-w32info.rc +++ b/tools/gpg-card-w32info.rc @@ -1,4 +1,4 @@ -/* gpg-card-toolt-w32info.rc -*- c -*- +/* gpg-card-w32info.rc -*- c -*- * Copyright (C) 2019 g10 Code GmbH * * This file is free software; as a special exception the author gives @@ -34,8 +34,8 @@ BEGIN VALUE "FileDescription", L"GnuPG\x2019s card tool \ to the agent\0" - VALUE "InternalName", "gpg-card-tool\0" - VALUE "OriginalFilename", "gpg-card-tool.exe\0" + VALUE "InternalName", "gpg-card\0" + VALUE "OriginalFilename", "gpg-card.exe\0" VALUE "ProductName", W32INFO_PRODUCTNAME VALUE "ProductVersion", W32INFO_PRODUCTVERSION VALUE "CompanyName", W32INFO_COMPANYNAME diff --git a/tools/gpg-card-tool.c b/tools/gpg-card.c similarity index 99% rename from tools/gpg-card-tool.c rename to tools/gpg-card.c index eb723d7ab..f1d0dc8fc 100644 --- a/tools/gpg-card-tool.c +++ b/tools/gpg-card.c @@ -1,4 +1,4 @@ -/* gpg-card-tool.c - An interactive tool to work with cards. +/* gpg-card.c - An interactive tool to work with cards. * Copyright (C) 2019 g10 Code GmbH * * This file is part of GnuPG. @@ -40,7 +40,7 @@ #include "../common/server-help.h" #include "../common/openpgpdefs.h" -#include "card-tool.h" +#include "gpg-card.h" #define CONTROL_D ('D' - 'A' + 1) @@ -143,7 +143,7 @@ my_strusage( int level ) switch (level) { - case 11: p = "gpg-card-tool"; break; + case 11: p = "gpg-card"; break; case 12: p = "@GNUPG@"; break; case 13: p = VERSION; break; case 17: p = PRINTABLE_OS_NAME; break; @@ -151,11 +151,11 @@ my_strusage( int level ) case 1: case 40: - p = ("Usage: gpg-card-tool" + p = ("Usage: gpg-card" " [options] [{[--] command [args]}] (-h for help)"); break; case 41: - p = ("Syntax: gpg-card-tool" + p = ("Syntax: gpg-card" " [options] [command [args] {-- command [args]}]\n\n" "Tool to manage cards and tokens. With a command an interactive\n" "mode is used. Use command \"help\" to list all commands."); @@ -224,7 +224,7 @@ parse_arguments (ARGPARSE_ARGS *pargs, ARGPARSE_OPTS *popts) -/* gpg-card-tool main. */ +/* gpg-card main. */ int main (int argc, char **argv) { @@ -234,10 +234,10 @@ main (int argc, char **argv) int cmdidx; char *command; - gnupg_reopen_std ("gpg-card-tool"); + gnupg_reopen_std ("gpg-card"); set_strusage (my_strusage); gnupg_rl_initialize (); - log_set_prefix ("gpg-card-tool", GPGRT_LOG_WITH_PREFIX); + log_set_prefix ("gpg-card", GPGRT_LOG_WITH_PREFIX); /* Make sure that our subsystems are ready. */ i18n_init(); diff --git a/tools/card-tool.h b/tools/gpg-card.h similarity index 97% rename from tools/card-tool.h rename to tools/gpg-card.h index 5598ae5fd..03bad7530 100644 --- a/tools/card-tool.h +++ b/tools/gpg-card.h @@ -1,4 +1,4 @@ -/* card-tool.h - Common definitions for the gpg-card-tool +/* gpg-card.h - Common definitions for the gpg-card-tool * Copyright (C) 2019 g10 Code GmbH * * This file is part of GnuPG. @@ -18,8 +18,8 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -#ifndef GNUPG_CARD_TOOL_H -#define GNUPG_CARD_TOOL_H +#ifndef GNUPG_GPG_CARD_H +#define GNUPG_GPG_CARD_H #include "../common/session-env.h" @@ -181,7 +181,7 @@ struct card_info_s typedef struct card_info_s *card_info_t; -/*-- card-tool-keys.c --*/ +/*-- card-keys.c --*/ void release_keyblock (keyblock_t keyblock); void flush_keyblock_cache (void); gpg_error_t get_matching_keys (const unsigned char *keygrip, int protocol, @@ -189,7 +189,7 @@ gpg_error_t get_matching_keys (const unsigned char *keygrip, int protocol, gpg_error_t test_get_matching_keys (const char *hexgrip); -/*-- card-tool-misc.c --*/ +/*-- card-misc.c --*/ key_info_t find_kinfo (card_info_t info, const char *keyref); void *hex_to_buffer (const char *string, size_t *r_length); gpg_error_t send_apdu (const char *hexapdu, const char *desc, @@ -222,8 +222,8 @@ gpg_error_t scd_checkpin (const char *serialno); unsigned long agent_get_s2k_count (void); -/*-- card-tool-yubikey.c --*/ +/*-- card-yubikey.c --*/ gpg_error_t yubikey_commands (estream_t fp, int argc, char *argv[]); -#endif /*GNUPG_CARD_TOOL_H*/ +#endif /*GNUPG_GPG_CARD_H*/