mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
See ChangeLog: Sat Mar 20 11:53:40 CET 1999 Werner Koch
This commit is contained in:
parent
8d255ff264
commit
fb8dbdbd95
14 changed files with 118 additions and 29 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Mar 20 11:44:21 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* g10.c (main): Added command --recv-keys
|
||||
* hkp.c (hkp_import): New.
|
||||
|
||||
Wed Mar 17 13:09:03 CET 1999 Werner Koch <wk@isil.d.shuttle.de>
|
||||
|
||||
* trustdb.c (check_trust): add new arg add_fnc and changed all callers.
|
||||
|
|
|
@ -85,6 +85,7 @@ enum cmd_and_opt_values { aNull = 0,
|
|||
aListSigs,
|
||||
aListSecretKeys,
|
||||
aSendKeys,
|
||||
aRecvKeys,
|
||||
aExport,
|
||||
aExportAll,
|
||||
aExportSecret,
|
||||
|
@ -189,6 +190,7 @@ static ARGPARSE_OPTS opts[] = {
|
|||
#endif
|
||||
{ aExport, "export" , 256, N_("export keys") },
|
||||
{ aSendKeys, "send-keys" , 256, N_("export keys to a key server") },
|
||||
{ aRecvKeys, "recv-keys" , 256, N_("import keys from a key server") },
|
||||
{ aExportAll, "export-all" , 256, "@" },
|
||||
{ aExportSecret, "export-secret-keys" , 256, "@" },
|
||||
{ aImport, "import", 256 , N_("import/merge keys")},
|
||||
|
@ -649,6 +651,7 @@ main( int argc, char **argv )
|
|||
case aImport: set_cmd( &cmd, aImport); break;
|
||||
case aFastImport: set_cmd( &cmd, aFastImport); break;
|
||||
case aSendKeys: set_cmd( &cmd, aSendKeys); break;
|
||||
case aRecvKeys: set_cmd( &cmd, aRecvKeys); break;
|
||||
case aExport: set_cmd( &cmd, aExport); break;
|
||||
case aExportAll: set_cmd( &cmd, aExportAll); break;
|
||||
case aListKeys: set_cmd( &cmd, aListKeys); break;
|
||||
|
@ -1108,11 +1111,14 @@ main( int argc, char **argv )
|
|||
case aExport:
|
||||
case aExportAll:
|
||||
case aSendKeys:
|
||||
case aRecvKeys:
|
||||
sl = NULL;
|
||||
for( ; argc; argc--, argv++ )
|
||||
add_to_strlist( &sl, *argv );
|
||||
if( cmd == aSendKeys )
|
||||
hkp_export( sl );
|
||||
else if( cmd == aRecvKeys )
|
||||
hkp_import( sl );
|
||||
else
|
||||
export_pubkeys( sl, (cmd == aExport) );
|
||||
free_strlist(sl);
|
||||
|
|
30
g10/hkp.c
30
g10/hkp.c
|
@ -64,7 +64,9 @@ hkp_ask_import( u32 *keyid )
|
|||
opt.keyserver_name, (ulong)keyid[1] );
|
||||
rc = http_open_document( &hd, request, 0 );
|
||||
if( rc ) {
|
||||
log_info("can't get key from keyserver: %s\n", g10_errstr(rc) );
|
||||
log_info("can't get key from keyserver: %s\n",
|
||||
rc == G10ERR_NETWORK? strerror(errno)
|
||||
: g10_errstr(rc) );
|
||||
}
|
||||
else {
|
||||
rc = import_keys_stream( hd.fp_read , 0 );
|
||||
|
@ -76,6 +78,28 @@ hkp_ask_import( u32 *keyid )
|
|||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
hkp_import( STRLIST users )
|
||||
{
|
||||
if( !opt.keyserver_name ) {
|
||||
log_error("no keyserver known (use option --keyserver)\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
for( ; users; users = users->next ) {
|
||||
u32 kid[2];
|
||||
int type = classify_user_id( users->d, kid, NULL, NULL, NULL );
|
||||
if( type != 10 && type != 11 ) {
|
||||
log_info("%s: not a valid key ID\n", users->d );
|
||||
continue;
|
||||
}
|
||||
hkp_ask_import( kid );
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
hkp_export( STRLIST users )
|
||||
{
|
||||
|
@ -110,7 +134,9 @@ hkp_export( STRLIST users )
|
|||
rc = http_open( &hd, HTTP_REQ_POST, request , 0 );
|
||||
if( rc ) {
|
||||
log_error("can't connect to `%s': %s\n",
|
||||
opt.keyserver_name, g10_errstr(rc) );
|
||||
opt.keyserver_name,
|
||||
rc == G10ERR_NETWORK? strerror(errno)
|
||||
: g10_errstr(rc) );
|
||||
iobuf_close(temp);
|
||||
m_free( request );
|
||||
return rc;
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
|
||||
|
||||
int hkp_ask_import( u32 *keyid );
|
||||
int hkp_import( STRLIST users );
|
||||
int hkp_export( STRLIST users );
|
||||
|
||||
|
||||
|
|
13
g10/revoke.c
13
g10/revoke.c
|
@ -62,6 +62,19 @@ gen_revoke( const char *uname )
|
|||
}
|
||||
|
||||
|
||||
/* FIXME: ask for the reason of revocation
|
||||
0x00 - No reason specified (key revocations or cert revocations)
|
||||
Does not make sense!
|
||||
|
||||
0x01 - Key is superceded (key revocations)
|
||||
0x02 - Key material has been compromised (key revocations)
|
||||
0x03 - Key is no longer used (key revocations)
|
||||
0x20 - User id information is no longer valid (cert revocations)
|
||||
|
||||
Following the revocation code is a string of octets which gives
|
||||
information about the reason for revocation in human-readable form
|
||||
*/
|
||||
|
||||
memset( &afx, 0, sizeof afx);
|
||||
memset( &zfx, 0, sizeof zfx);
|
||||
init_packet( &pkt );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue