mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-21 14:47:03 +01:00
* options.h, gpg.c (main), keygen.c (keygen_upd_std_prefs,
keygen_add_std_prefs, proc_parameter_file): Add --default-keyserver-url to specify a keyserver URL at key generation time, and "Keyserver:" keyword for doing the same through a batch file.
This commit is contained in:
parent
059c67ca6d
commit
00db922029
@ -1,5 +1,11 @@
|
||||
2006-06-22 David Shaw <dshaw@jabberwocky.com>
|
||||
|
||||
* options.h, gpg.c (main), keygen.c (keygen_upd_std_prefs,
|
||||
keygen_add_std_prefs, proc_parameter_file): Add
|
||||
--default-keyserver-url to specify a keyserver URL at key
|
||||
generation time, and "Keyserver:" keyword for doing the same
|
||||
through a batch file.
|
||||
|
||||
* sign.c (do_sign): Accept a truncated hash even for DSA1 keys (be
|
||||
liberal in what you accept, etc).
|
||||
|
||||
|
15
g10/gpg.c
15
g10/gpg.c
@ -333,6 +333,7 @@ enum cmd_and_opt_values
|
||||
oNoAutoCheckTrustDB,
|
||||
oPreservePermissions,
|
||||
oDefaultPreferenceList,
|
||||
oDefaultKeyserverURL,
|
||||
oPersonalCipherPreferences,
|
||||
oPersonalDigestPreferences,
|
||||
oPersonalCompressPreferences,
|
||||
@ -667,6 +668,7 @@ static ARGPARSE_OPTS opts[] = {
|
||||
{ aRebuildKeydbCaches, "rebuild-keydb-caches", 256, "@"},
|
||||
{ oPreservePermissions, "preserve-permissions", 0, "@"},
|
||||
{ oDefaultPreferenceList, "default-preference-list", 2, "@"},
|
||||
{ oDefaultKeyserverURL, "default-keyserver-url", 2, "@"},
|
||||
{ oPersonalCipherPreferences, "personal-cipher-preferences", 2, "@"},
|
||||
{ oPersonalDigestPreferences, "personal-digest-preferences", 2, "@"},
|
||||
{ oPersonalCompressPreferences, "personal-compress-preferences", 2, "@"},
|
||||
@ -2652,6 +2654,19 @@ main (int argc, char **argv )
|
||||
case oDefaultPreferenceList:
|
||||
opt.def_preference_list = pargs.r.ret_str;
|
||||
break;
|
||||
case oDefaultKeyserverURL:
|
||||
{
|
||||
struct keyserver_spec *keyserver;
|
||||
keyserver=parse_keyserver_uri(pargs.r.ret_str,1,
|
||||
configname,configlineno);
|
||||
if(!keyserver)
|
||||
log_error(_("could not parse keyserver URL\n"));
|
||||
else
|
||||
free_keyserver_spec(keyserver);
|
||||
|
||||
opt.def_keyserver_url = pargs.r.ret_str;
|
||||
}
|
||||
break;
|
||||
case oPersonalCipherPreferences:
|
||||
pers_cipher_list=pargs.r.ret_str;
|
||||
break;
|
||||
|
29
g10/keygen.c
29
g10/keygen.c
@ -41,6 +41,7 @@
|
||||
#include "status.h"
|
||||
#include "i18n.h"
|
||||
#include "cardglue.h"
|
||||
#include "keyserver-internal.h"
|
||||
|
||||
#define MAX_PREFS 30
|
||||
|
||||
@ -66,7 +67,8 @@ enum para_name {
|
||||
pPASSPHRASE_S2K,
|
||||
pSERIALNO,
|
||||
pBACKUPENCDIR,
|
||||
pHANDLE
|
||||
pHANDLE,
|
||||
pKEYSERVER
|
||||
};
|
||||
|
||||
struct para_data_s {
|
||||
@ -655,6 +657,7 @@ keygen_upd_std_prefs( PKT_signature *sig, void *opaque )
|
||||
/* Make sure that the MDC feature flag is set if needed */
|
||||
add_feature_mdc (sig,mdc_available);
|
||||
add_keyserver_modify (sig,ks_modify);
|
||||
keygen_add_keyserver_url(sig,NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -673,6 +676,7 @@ keygen_add_std_prefs( PKT_signature *sig, void *opaque )
|
||||
do_add_key_flags (sig, pk->pubkey_usage);
|
||||
keygen_add_key_expire( sig, opaque );
|
||||
keygen_upd_std_prefs (sig, opaque);
|
||||
keygen_add_keyserver_url(sig,NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@ -682,6 +686,9 @@ keygen_add_keyserver_url(PKT_signature *sig, void *opaque)
|
||||
{
|
||||
const char *url=opaque;
|
||||
|
||||
if(!url)
|
||||
url=opt.def_keyserver_url;
|
||||
|
||||
if(url)
|
||||
build_sig_subpkt(sig,SIGSUBPKT_PREF_KS,url,strlen(url));
|
||||
else
|
||||
@ -2238,6 +2245,25 @@ proc_parameter_file( struct para_data_s *para, const char *fname,
|
||||
/* Set preferences, if any. */
|
||||
keygen_set_std_prefs(get_parameter_value( para, pPREFERENCES ), 0);
|
||||
|
||||
/* Set keyserver, if any. */
|
||||
s1=get_parameter_value( para, pKEYSERVER );
|
||||
if(s1)
|
||||
{
|
||||
struct keyserver_spec *spec;
|
||||
|
||||
spec=parse_keyserver_uri(s1,1,NULL,0);
|
||||
if(spec)
|
||||
{
|
||||
free_keyserver_spec(spec);
|
||||
opt.def_keyserver_url=s1;
|
||||
}
|
||||
else
|
||||
{
|
||||
log_error("%s:%d: invalid keyserver url\n", fname, r->lnr );
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Set revoker, if any. */
|
||||
if (parse_revocation_key (fname, para, pREVOKER))
|
||||
return -1;
|
||||
@ -2330,6 +2356,7 @@ read_parameter_file( const char *fname )
|
||||
{ "Preferences", pPREFERENCES },
|
||||
{ "Revoker", pREVOKER },
|
||||
{ "Handle", pHANDLE },
|
||||
{ "Keyserver", pKEYSERVER },
|
||||
{ NULL, 0 }
|
||||
};
|
||||
IOBUF fp;
|
||||
|
@ -154,7 +154,8 @@ struct
|
||||
unsigned int export_options;
|
||||
unsigned int list_options;
|
||||
unsigned int verify_options;
|
||||
char *def_preference_list;
|
||||
const char *def_preference_list;
|
||||
const char *def_keyserver_url;
|
||||
prefitem_t *personal_cipher_prefs;
|
||||
prefitem_t *personal_digest_prefs;
|
||||
prefitem_t *personal_compress_prefs;
|
||||
|
Loading…
x
Reference in New Issue
Block a user