mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-23 10:29:58 +01:00
* g10.c. options.h : New option --show-keyring
* getkey.c (get_ctx_handle): New. * keylist.c (list_one): Implement option here. By David Champion.
This commit is contained in:
parent
b8f83e2be8
commit
ca1bc23ef2
@ -1,3 +1,9 @@
|
|||||||
|
2001-12-21 Werner Koch <wk@gnupg.org>
|
||||||
|
|
||||||
|
* g10.c. options.h : New option --show-keyring
|
||||||
|
* getkey.c (get_ctx_handle): New.
|
||||||
|
* keylist.c (list_one): Implement option here. By David Champion.
|
||||||
|
|
||||||
2001-12-20 David Shaw <dshaw@jabberwocky.com>
|
2001-12-20 David Shaw <dshaw@jabberwocky.com>
|
||||||
|
|
||||||
* keyserver.c (keyserver_spawn): Use mkdtemp() to make temp
|
* keyserver.c (keyserver_spawn): Use mkdtemp() to make temp
|
||||||
|
@ -129,6 +129,7 @@ enum cmd_and_opt_values { aNull = 0,
|
|||||||
oNoDefCheckLevel,
|
oNoDefCheckLevel,
|
||||||
oKeyring,
|
oKeyring,
|
||||||
oSecretKeyring,
|
oSecretKeyring,
|
||||||
|
oShowKeyring,
|
||||||
oDefaultKey,
|
oDefaultKey,
|
||||||
oDefRecipient,
|
oDefRecipient,
|
||||||
oDefRecipientSelf,
|
oDefRecipientSelf,
|
||||||
@ -346,6 +347,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||||||
{ oAnswerNo, "no", 0, N_("assume no on most questions")},
|
{ oAnswerNo, "no", 0, N_("assume no on most questions")},
|
||||||
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
|
{ oKeyring, "keyring" ,2, N_("add this keyring to the list of keyrings")},
|
||||||
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
|
{ oSecretKeyring, "secret-keyring" ,2, N_("add this secret keyring to the list")},
|
||||||
|
{ oShowKeyring, "show-keyring", 0, N_("show which keyring a listed key is on")},
|
||||||
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
|
{ oDefaultKey, "default-key" ,2, N_("|NAME|use NAME as default secret key")},
|
||||||
{ oKeyServer, "keyserver",2, N_("|HOST|use this keyserver to lookup keys")},
|
{ oKeyServer, "keyserver",2, N_("|HOST|use this keyserver to lookup keys")},
|
||||||
{ oKeyServerOptions, "keyserver-options",2,"@"},
|
{ oKeyServerOptions, "keyserver-options",2,"@"},
|
||||||
@ -931,6 +933,7 @@ main( int argc, char **argv )
|
|||||||
case oAnswerYes: opt.answer_yes = 1; break;
|
case oAnswerYes: opt.answer_yes = 1; break;
|
||||||
case oAnswerNo: opt.answer_no = 1; break;
|
case oAnswerNo: opt.answer_no = 1; break;
|
||||||
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
|
case oKeyring: append_to_strlist( &nrings, pargs.r.ret_str); break;
|
||||||
|
case oShowKeyring: opt.show_keyring = 1; break;
|
||||||
case oDebug: opt.debug |= pargs.r.ret_ulong; break;
|
case oDebug: opt.debug |= pargs.r.ret_ulong; break;
|
||||||
case oDebugAll: opt.debug = ~0; break;
|
case oDebugAll: opt.debug = ~0; break;
|
||||||
case oStatusFD:
|
case oStatusFD:
|
||||||
|
@ -2194,4 +2194,8 @@ get_user_id( u32 *keyid, size_t *rn )
|
|||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char*
|
||||||
|
get_ctx_handle(GETKEY_CTX ctx)
|
||||||
|
{
|
||||||
|
return ctx->kr_handle;
|
||||||
|
}
|
||||||
|
@ -209,6 +209,7 @@ char*get_user_id_string( u32 *keyid );
|
|||||||
char*get_user_id_string_native( u32 *keyid );
|
char*get_user_id_string_native( u32 *keyid );
|
||||||
char*get_long_user_id_string( u32 *keyid );
|
char*get_long_user_id_string( u32 *keyid );
|
||||||
char*get_user_id( u32 *keyid, size_t *rn );
|
char*get_user_id( u32 *keyid, size_t *rn );
|
||||||
|
const char*get_ctx_handle(GETKEY_CTX ctx);
|
||||||
|
|
||||||
/*-- keyid.c --*/
|
/*-- keyid.c --*/
|
||||||
int pubkey_letter( int algo );
|
int pubkey_letter( int algo );
|
||||||
|
@ -173,6 +173,9 @@ list_one( STRLIST names, int secret )
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
KBNODE keyblock = NULL;
|
KBNODE keyblock = NULL;
|
||||||
GETKEY_CTX ctx;
|
GETKEY_CTX ctx;
|
||||||
|
char *resname;
|
||||||
|
char *keyring_str = N_("Keyring");
|
||||||
|
int i;
|
||||||
|
|
||||||
/* fixme: using the bynames function has the disadvantage that we
|
/* fixme: using the bynames function has the disadvantage that we
|
||||||
* don't know wether one of the names given was not found. OTOH,
|
* don't know wether one of the names given was not found. OTOH,
|
||||||
@ -191,6 +194,13 @@ list_one( STRLIST names, int secret )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
if (opt.show_keyring) {
|
||||||
|
resname = keydb_get_resource_name (get_ctx_handle(ctx));
|
||||||
|
printf("%s: %s\n", keyring_str, resname);
|
||||||
|
for(i = strlen(resname) + strlen(keyring_str) + 2; i; i-- )
|
||||||
|
putchar('-');
|
||||||
|
putchar('\n');
|
||||||
|
}
|
||||||
list_keyblock( keyblock, 1 );
|
list_keyblock( keyblock, 1 );
|
||||||
release_kbnode( keyblock );
|
release_kbnode( keyblock );
|
||||||
} while( !get_seckey_next( ctx, NULL, &keyblock ) );
|
} while( !get_seckey_next( ctx, NULL, &keyblock ) );
|
||||||
@ -204,6 +214,13 @@ list_one( STRLIST names, int secret )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
|
if (opt.show_keyring) {
|
||||||
|
resname = keydb_get_resource_name (get_ctx_handle(ctx));
|
||||||
|
printf("%s: %s\n", keyring_str, resname);
|
||||||
|
for(i = strlen(resname) + strlen(keyring_str) + 2; i; i-- )
|
||||||
|
putchar('-');
|
||||||
|
putchar('\n');
|
||||||
|
}
|
||||||
list_keyblock( keyblock, 0 );
|
list_keyblock( keyblock, 0 );
|
||||||
release_kbnode( keyblock );
|
release_kbnode( keyblock );
|
||||||
} while( !get_pubkey_next( ctx, NULL, &keyblock ) );
|
} while( !get_pubkey_next( ctx, NULL, &keyblock ) );
|
||||||
|
@ -217,11 +217,11 @@ add_signature( CTX c, PACKET *pkt )
|
|||||||
|
|
||||||
if( pkt->pkttype == PKT_SIGNATURE && !c->list ) {
|
if( pkt->pkttype == PKT_SIGNATURE && !c->list ) {
|
||||||
/* This is the first signature for the following datafile.
|
/* This is the first signature for the following datafile.
|
||||||
* G10 does not write such packets; instead it always uses
|
* GPG does not write such packets; instead it always uses
|
||||||
* onepass-sig packets. The drawback of PGP's method
|
* onepass-sig packets. The drawback of PGP's method
|
||||||
* of prepending the signature to the data is
|
* of prepending the signature to the data is
|
||||||
* that it is not possible to make a signature from data read
|
* that it is not possible to make a signature from data read
|
||||||
* from stdin. (G10 is able to read PGP stuff anyway.) */
|
* from stdin. (GPG is able to read PGP stuff anyway.) */
|
||||||
node = new_kbnode( pkt );
|
node = new_kbnode( pkt );
|
||||||
c->list = node;
|
c->list = node;
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -137,6 +137,7 @@ struct {
|
|||||||
int no_auto_check_trustdb;
|
int no_auto_check_trustdb;
|
||||||
int preserve_permissions;
|
int preserve_permissions;
|
||||||
int no_homedir_creation;
|
int no_homedir_creation;
|
||||||
|
int show_keyring;
|
||||||
} opt;
|
} opt;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user