diff options
author | Werner Koch <[email protected]> | 2003-12-16 16:31:16 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2003-12-16 16:31:16 +0000 |
commit | a41d45af627c7d9cc66d581ea18521a73fc2660e (patch) | |
tree | 7bb07d5f57e6c0e1af4b286211f8144508bddab1 /sm/sign.c | |
parent | (main): Set the prefixes for assuan logging. (diff) | |
download | gnupg-a41d45af627c7d9cc66d581ea18521a73fc2660e.tar.gz gnupg-a41d45af627c7d9cc66d581ea18521a73fc2660e.zip |
* 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.
Diffstat (limited to '')
-rw-r--r-- | sm/sign.c | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -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 - keyDB retruns and has a secret key available */ + keyDB returns and has a secret key available. */ int gpgsm_get_default_cert (KsbaCert *r_cert) { @@ -364,6 +364,17 @@ gpgsm_sign (CTRL ctrl, CERTLIST signerlist, rc = gpg_error (GPG_ERR_GENERAL); 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); if (!signerlist) { |