1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-22 10:19:57 +01:00

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 <wk@gnupg.org>
This commit is contained in:
Werner Koch 2019-02-25 09:28:22 +01:00
parent a12c3a566e
commit 28de5c0ea5
No known key found for this signature in database
GPG Key ID: E3FDFF218E45B72B
12 changed files with 61 additions and 54 deletions

View File

@ -69,7 +69,7 @@ nobase_dist_doc_DATA = FAQ DETAILS HACKING DCO TRANSLATE OpenPGP KEYSERVER \
gnupg_TEXINFOS = \ gnupg_TEXINFOS = \
gpg.texi gpgsm.texi gpg-agent.texi scdaemon.texi instguide.texi \ gpg.texi gpgsm.texi gpg-agent.texi scdaemon.texi instguide.texi \
tools.texi debugging.texi glossary.texi contrib.texi gpl.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-module-overview.svg \
gnupg-card-architecture.fig \ gnupg-card-architecture.fig \
howtos.texi howto-create-a-server-cert.texi 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 \ myman_sources = gnupg7.texi gpg.texi gpgsm.texi gpg-agent.texi \
dirmngr.texi scdaemon.texi tools.texi wks.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 \ myman_pages = gpgsm.1 gpg-agent.1 dirmngr.8 scdaemon.1 \
watchgnupg.1 gpgconf.1 addgnupghome.8 gpg-preset-passphrase.1 \ watchgnupg.1 gpgconf.1 addgnupghome.8 gpg-preset-passphrase.1 \
gpg-connect-agent.1 gpgparsemail.1 symcryptrun.1 gpgtar.1 \ gpg-connect-agent.1 gpgparsemail.1 symcryptrun.1 gpgtar.1 \
applygnupgdefaults.8 gpg-wks-client.1 gpg-wks-server.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 if USE_GPG2_HACK
myman_pages += gpg2.1 gpgv2.1 myman_pages += gpg2.1 gpgv2.1
else else

View File

@ -187,7 +187,7 @@ the administration and the architecture.
@cindex trust values @cindex trust values
@include trust-values.texi @include trust-values.texi
@include card-tool.texi @include gpg-card.texi
@include tools.texi @include tools.texi
@include wks.texi @include wks.texi

View File

@ -13,26 +13,26 @@ tool is an extension of the @option{--edit-key} command available with
@command{gpg}. @command{gpg}.
@menu @menu
* gpg-card-tool:: Administrate smart cards. * gpg-card:: Administrate smart cards.
@end menu @end menu
@c @c
@c GPG-CARD-TOOL @c GPG-CARD-TOOL
@c @c
@manpage gpg-card-tool.1 @manpage gpg-card.1
@node gpg-card-tool @node gpg-card
@section Administrate smart cards. @section Administrate smart cards.
@ifset manverb @ifset manverb
.B gpg-card-tool .B gpg-card
\- Administrate Smart Cards \- Administrate Smart Cards
@end ifset @end ifset
@mansect synopsis @mansect synopsis
@ifset manverb @ifset manverb
.B gpg-card-tool .B gpg-card
.RI [ options ] .RI [ options ]
.br .br
.B gpg-card-tool .B gpg-card
.RI [ options ] .RI [ options ]
.I command .I command
.RI { .RI {
@ -42,16 +42,16 @@ tool is an extension of the @option{--edit-key} command available with
@end ifset @end ifset
@mansect description @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 tokens. It provides a superset of features from @command{gpg
--card-edit} an can be considered a frontend to @command{scdaemon} --card-edit} an can be considered a frontend to @command{scdaemon}
which is a daemon started by @command{gpg-agent} to handle smart which is a daemon started by @command{gpg-agent} to handle smart
cards. 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. 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 same commands as available in the interactive mode are run from the
command line. These commands need to be delimited with a double-dash. 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 If a double-dash or a shell specific character is required as part of
@ -66,7 +66,7 @@ COMMAND}.
@mansect options @mansect options
@noindent @noindent
@command{gpg-card-tool} understands these options: @command{gpg-card} understands these options:
@table @gnupgtabopt @table @gnupgtabopt

View File

@ -127,5 +127,8 @@ tools/gpgconf.c
tools/no-libgcrypt.c tools/no-libgcrypt.c
tools/symcryptrun.c tools/symcryptrun.c
tools/gpg-check-pattern.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 tools/card-call-scd.c

View File

@ -22,14 +22,14 @@ EXTRA_DIST = \
lspgpot mail-signed-keys convert-from-106 sockprox.c \ lspgpot mail-signed-keys convert-from-106 sockprox.c \
ccidmon.c ChangeLog-2011 \ ccidmon.c ChangeLog-2011 \
gpg-connect-agent-w32info.rc \ gpg-connect-agent-w32info.rc \
gpg-card-tool-w32info.rc gpg-card-w32info.rc
AM_CPPFLAGS = AM_CPPFLAGS =
include $(top_srcdir)/am/cmacros.am include $(top_srcdir)/am/cmacros.am
if HAVE_W32_SYSTEM if HAVE_W32_SYSTEM
gpg_connect_agent_rc_objs = gpg-connect-agent-w32info.o 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) resource_objs += $(gpg_connect_agent_rc_objs) $(gpg_card_tool_rc_objs)
endif endif
@ -51,7 +51,7 @@ endif
libexec_PROGRAMS = gpg-wks-client gpg-pair-tool 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 if !HAVE_W32_SYSTEM
bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server} bin_PROGRAMS += watchgnupg gpgparsemail ${gpg_wks_server}
endif endif
@ -124,19 +124,20 @@ gpg_connect_agent_LDADD = ../common/libgpgrl.a $(common_libs) \
$(gpg_connect_agent_rc_objs) $(gpg_connect_agent_rc_objs)
gpg_card_tool_SOURCES = \ gpg_card_SOURCES = \
gpg-card-tool.c \ gpg-card.c \
card-tool.h \ gpg-card.h \
card-call-scd.c \ card-call-scd.c \
card-tool-keys.c \ card-keys.c \
card-tool-yubikey.c \ card-yubikey.c \
card-tool-misc.c card-misc.c
gpg_card_tool_LDADD = ../common/libgpgrl.a $(common_libs) \ gpg_card_LDADD = \
$(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \ ../common/libgpgrl.a $(common_libs) \
$(GPG_ERROR_LIBS) \ $(LIBASSUAN_LIBS) $(LIBGCRYPT_LIBS) \
$(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \ $(GPG_ERROR_LIBS) \
$(gpg_card_tool_rc_objs) $(LIBREADLINE) $(LIBINTL) $(NETLIBS) $(LIBICONV) \
$(gpg_card_tool_rc_objs)
if !DISABLE_REGEX if !DISABLE_REGEX

View File

@ -39,7 +39,7 @@
#include "../common/status.h" #include "../common/status.h"
#include "../common/host2net.h" #include "../common/host2net.h"
#include "../common/openpgpdefs.h" #include "../common/openpgpdefs.h"
#include "card-tool.h" #include "gpg-card.h"
#define CONTROL_D ('D' - 'A' + 1) #define CONTROL_D ('D' - 'A' + 1)

View File

@ -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 * Copyright (C) 2019 g10 Code GmbH
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -28,7 +28,7 @@
#include "../common/ccparray.h" #include "../common/ccparray.h"
#include "../common/exectool.h" #include "../common/exectool.h"
#include "../common/openpgpdefs.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 /* 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; pubkey_t pubkey;
(void)fields; /* Not yet used. */
(void)nfields;
pubkey = xtrycalloc (1, sizeof *pubkey); pubkey = xtrycalloc (1, sizeof *pubkey);
if (!pubkey) if (!pubkey)
return gpg_error_from_syserror (); return gpg_error_from_syserror ();

View File

@ -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 * Copyright (C) 2019 g10 Code GmbH
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -28,7 +28,7 @@
#include "../common/util.h" #include "../common/util.h"
#include "../common/i18n.h" #include "../common/i18n.h"
#include "../common/openpgpdefs.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 /* Return the key info object for the key KEYREF. If it is not found
* NULL is returned. */ * NULL is returned. */

View File

@ -1,4 +1,4 @@
/* card-tool-yubikey.c - Yubikey specific functions. /* card-yubikey.c - Yubikey specific functions.
* Copyright (C) 2019 g10 Code GmbH * Copyright (C) 2019 g10 Code GmbH
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -29,7 +29,7 @@
#include "../common/i18n.h" #include "../common/i18n.h"
#include "../common/tlv.h" #include "../common/tlv.h"
#include "../common/ttyio.h" #include "../common/ttyio.h"
#include "card-tool.h" #include "gpg-card.h"
/* Object to describe requested interface options. */ /* Object to describe requested interface options. */

View File

@ -1,4 +1,4 @@
/* gpg-card-toolt-w32info.rc -*- c -*- /* gpg-card-w32info.rc -*- c -*-
* Copyright (C) 2019 g10 Code GmbH * Copyright (C) 2019 g10 Code GmbH
* *
* This file is free software; as a special exception the author gives * This file is free software; as a special exception the author gives
@ -34,8 +34,8 @@
BEGIN BEGIN
VALUE "FileDescription", L"GnuPG\x2019s card tool \ VALUE "FileDescription", L"GnuPG\x2019s card tool \
to the agent\0" to the agent\0"
VALUE "InternalName", "gpg-card-tool\0" VALUE "InternalName", "gpg-card\0"
VALUE "OriginalFilename", "gpg-card-tool.exe\0" VALUE "OriginalFilename", "gpg-card.exe\0"
VALUE "ProductName", W32INFO_PRODUCTNAME VALUE "ProductName", W32INFO_PRODUCTNAME
VALUE "ProductVersion", W32INFO_PRODUCTVERSION VALUE "ProductVersion", W32INFO_PRODUCTVERSION
VALUE "CompanyName", W32INFO_COMPANYNAME VALUE "CompanyName", W32INFO_COMPANYNAME

View File

@ -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 * Copyright (C) 2019 g10 Code GmbH
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -40,7 +40,7 @@
#include "../common/server-help.h" #include "../common/server-help.h"
#include "../common/openpgpdefs.h" #include "../common/openpgpdefs.h"
#include "card-tool.h" #include "gpg-card.h"
#define CONTROL_D ('D' - 'A' + 1) #define CONTROL_D ('D' - 'A' + 1)
@ -143,7 +143,7 @@ my_strusage( int level )
switch (level) switch (level)
{ {
case 11: p = "gpg-card-tool"; break; case 11: p = "gpg-card"; break;
case 12: p = "@GNUPG@"; break; case 12: p = "@GNUPG@"; break;
case 13: p = VERSION; break; case 13: p = VERSION; break;
case 17: p = PRINTABLE_OS_NAME; break; case 17: p = PRINTABLE_OS_NAME; break;
@ -151,11 +151,11 @@ my_strusage( int level )
case 1: case 1:
case 40: case 40:
p = ("Usage: gpg-card-tool" p = ("Usage: gpg-card"
" [options] [{[--] command [args]}] (-h for help)"); " [options] [{[--] command [args]}] (-h for help)");
break; break;
case 41: case 41:
p = ("Syntax: gpg-card-tool" p = ("Syntax: gpg-card"
" [options] [command [args] {-- command [args]}]\n\n" " [options] [command [args] {-- command [args]}]\n\n"
"Tool to manage cards and tokens. With a command an interactive\n" "Tool to manage cards and tokens. With a command an interactive\n"
"mode is used. Use command \"help\" to list all commands."); "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 int
main (int argc, char **argv) main (int argc, char **argv)
{ {
@ -234,10 +234,10 @@ main (int argc, char **argv)
int cmdidx; int cmdidx;
char *command; char *command;
gnupg_reopen_std ("gpg-card-tool"); gnupg_reopen_std ("gpg-card");
set_strusage (my_strusage); set_strusage (my_strusage);
gnupg_rl_initialize (); 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. */ /* Make sure that our subsystems are ready. */
i18n_init(); i18n_init();

View File

@ -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 * Copyright (C) 2019 g10 Code GmbH
* *
* This file is part of GnuPG. * This file is part of GnuPG.
@ -18,8 +18,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later * SPDX-License-Identifier: GPL-3.0-or-later
*/ */
#ifndef GNUPG_CARD_TOOL_H #ifndef GNUPG_GPG_CARD_H
#define GNUPG_CARD_TOOL_H #define GNUPG_GPG_CARD_H
#include "../common/session-env.h" #include "../common/session-env.h"
@ -181,7 +181,7 @@ struct card_info_s
typedef struct card_info_s *card_info_t; typedef struct card_info_s *card_info_t;
/*-- card-tool-keys.c --*/ /*-- card-keys.c --*/
void release_keyblock (keyblock_t keyblock); void release_keyblock (keyblock_t keyblock);
void flush_keyblock_cache (void); void flush_keyblock_cache (void);
gpg_error_t get_matching_keys (const unsigned char *keygrip, int protocol, 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); 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); key_info_t find_kinfo (card_info_t info, const char *keyref);
void *hex_to_buffer (const char *string, size_t *r_length); void *hex_to_buffer (const char *string, size_t *r_length);
gpg_error_t send_apdu (const char *hexapdu, const char *desc, 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); 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[]); gpg_error_t yubikey_commands (estream_t fp, int argc, char *argv[]);
#endif /*GNUPG_CARD_TOOL_H*/ #endif /*GNUPG_GPG_CARD_H*/