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

* gpgsm.c (main): Set the prefixes for assuan logging.

* sign.c (gpgsm_sign): Add validation checks for the default
certificate.

* gpgsm.c: Add -k as alias for --list-keys and -K for
--list-secret-keys.
This commit is contained in:
Werner Koch 2003-12-16 16:31:16 +00:00
parent f438224dae
commit a41d45af62
4 changed files with 30 additions and 6 deletions

View File

@ -1,3 +1,13 @@
2003-12-16 Werner Koch <wk@gnupg.org>
* gpgsm.c (main): Set the prefixes for assuan logging.
* sign.c (gpgsm_sign): Add validation checks for the default
certificate.
* gpgsm.c: Add -k as alias for --list-keys and -K for
--list-secret-keys.
2003-12-15 Werner Koch <wk@gnupg.org> 2003-12-15 Werner Koch <wk@gnupg.org>
* encrypt.c (init_dek): Use gry_create_nonce for the IV; there is * encrypt.c (init_dek): Use gry_create_nonce for the IV; there is

View File

@ -135,7 +135,7 @@ same_subject_issuer (const char *subject, const char *issuer, KsbaCert cert)
/* Add a certificate to a list of certificate and make sure that it is /* Add a certificate to a list of certificate and make sure that it is
a valid certificate. With SECRET set to true a secret key must be a valid certificate. With SECRET set to true a secret key must be
avaibale for the certificate. */ available for the certificate. */
int int
gpgsm_add_to_certlist (CTRL ctrl, const char *name, int secret, gpgsm_add_to_certlist (CTRL ctrl, const char *name, int secret,
CERTLIST *listaddr) CERTLIST *listaddr)
@ -190,7 +190,7 @@ gpgsm_add_to_certlist (CTRL ctrl, const char *name, int secret,
} }
} }
/* we want the error code from the first match in this case */ /* We want the error code from the first match in this case. */
if (rc && wrong_usage) if (rc && wrong_usage)
rc = wrong_usage; rc = wrong_usage;

View File

@ -44,7 +44,8 @@ enum cmd_and_opt_values {
aDecrypt = 'd', aDecrypt = 'd',
aEncr = 'e', aEncr = 'e',
oInteractive = 'i', oInteractive = 'i',
oKOption = 'k', aListKeys = 'k',
aListSecretKeys = 'K',
oDryRun = 'n', oDryRun = 'n',
oOutput = 'o', oOutput = 'o',
oQuiet = 'q', oQuiet = 'q',
@ -68,10 +69,8 @@ enum cmd_and_opt_values {
aImport, aImport,
aVerify, aVerify,
aVerifyFiles, aVerifyFiles,
aListKeys,
aListExternalKeys, aListExternalKeys,
aListSigs, aListSigs,
aListSecretKeys,
aSendKeys, aSendKeys,
aRecvKeys, aRecvKeys,
aExport, aExport,
@ -695,7 +694,11 @@ main ( int argc, char **argv)
*/ */
ksba_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free ); ksba_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free );
assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free); assuan_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
assuan_set_assuan_log_stream (log_get_stream ());
assuan_set_assuan_log_prefix (log_get_prefix (NULL));
keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free); keybox_set_malloc_hooks (gcry_malloc, gcry_realloc, gcry_free);
/* Setup a default control structure for command line mode */ /* Setup a default control structure for command line mode */

View File

@ -124,7 +124,7 @@ hash_and_copy_data (int fd, gcry_md_hd_t md, KsbaWriter writer)
/* Get the default certificate which is defined as the first one our /* Get the default certificate which is defined as the first one our
keyDB retruns and has a secret key available */ keyDB returns and has a secret key available. */
int int
gpgsm_get_default_cert (KsbaCert *r_cert) gpgsm_get_default_cert (KsbaCert *r_cert)
{ {
@ -364,6 +364,17 @@ gpgsm_sign (CTRL ctrl, CERTLIST signerlist,
rc = gpg_error (GPG_ERR_GENERAL); rc = gpg_error (GPG_ERR_GENERAL);
goto leave; goto leave;
} }
/* Although we don't check for ambigious specification we will
check that the signer's certificate is is usable and
valid. */
rc = gpgsm_cert_use_sign_p (cert);
if (!rc)
rc = gpgsm_validate_chain (ctrl, cert, NULL);
if (rc)
goto leave;
/* That one is fine - create signerlist. */
signerlist = xtrycalloc (1, sizeof *signerlist); signerlist = xtrycalloc (1, sizeof *signerlist);
if (!signerlist) if (!signerlist)
{ {