1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Typo fixes.

Made --default-key work for gpgsm
Add --default-key and --encrypt-to to gpgconf.
This commit is contained in:
Werner Koch 2007-07-17 18:11:24 +00:00
parent 2d4e157d85
commit 11573b09c4
13 changed files with 70 additions and 14 deletions

View file

@ -1,3 +1,8 @@
2007-07-17 Werner Koch <wk@g10code.com>
* gpgsm.c (main): Implement --default-key.
(main) <gpgconf-list>: Declare --default-key and --encrypt-to.
2007-07-16 Werner Koch <wk@g10code.com>
* server.c (cmd_message): Use gnupg_fd_t to avoid dependecy on

View file

@ -1101,8 +1101,11 @@ main ( int argc, char **argv)
case oNoGreeting: nogreeting = 1; break;
case oDefaultKey:
/* fixme:opt.def_secret_key = pargs.r.ret_str;*/
log_info ("WARNING: --default-key has not yet been implemented\n");
if (*pargs.r.ret_str)
{
xfree (opt.local_user);
opt.local_user = xstrdup (pargs.r.ret_str);
}
break;
case oDefRecipient:
if (*pargs.r.ret_str)
@ -1139,9 +1142,9 @@ main ( int argc, char **argv)
case oTextmodeShort: /*fixme:opt.textmode = 2;*/ break;
case oTextmode: /*fixme:opt.textmode=1;*/ break;
case oUser: /* store the local users, the first one is the default */
case oUser: /* Store the local users, the first one is the default */
if (!opt.local_user)
opt.local_user = pargs.r.ret_str;
opt.local_user = xstrdup (pargs.r.ret_str);
add_to_strlist (&locusr, pargs.r.ret_str);
break;
@ -1424,6 +1427,10 @@ main ( int argc, char **argv)
GC_OPT_FLAG_DEFAULT );
printf ("p12-charset:%lu:\n",
GC_OPT_FLAG_DEFAULT );
printf ("default-key:%lu:\n",
GC_OPT_FLAG_DEFAULT );
printf ("encrypt-to:%lu:\n",
GC_OPT_FLAG_DEFAULT );
}
break;

View file

@ -122,8 +122,9 @@ hash_and_copy_data (int fd, gcry_md_hd_t md, ksba_writer_t writer)
}
/* Get the default certificate which is defined as the first cabable
of signing our keyDB returns and has a secret key available. */
/* Get the default certificate which is defined as the first
certificate capable of signing returned by the keyDB and has a
secret key available. */
int
gpgsm_get_default_cert (ctrl_t ctrl, ksba_cert_t *r_cert)
{
@ -364,7 +365,7 @@ gpgsm_sign (ctrl_t ctrl, certlist_t signerlist,
goto leave;
}
/* If no list of signers is given, use a default one. */
/* If no list of signers is given, use the default certificate. */
if (!signerlist)
{
ksba_cert_t cert = get_default_signer (ctrl);
@ -376,8 +377,7 @@ gpgsm_sign (ctrl_t ctrl, certlist_t signerlist,
}
/* Although we don't check for ambigious specification we will
check that the signer's certificate is is usable and
valid. */
check that the signer's certificate is usable and valid. */
rc = gpgsm_cert_use_sign_p (cert);
if (!rc)
rc = gpgsm_validate_chain (ctrl, cert, NULL, 0, NULL, 0);