mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* sign.c (gpgsm_sign): Include the error source in the final error
message. * decrypt.c (gpgsm_decrypt): Ditto. * fingerprint.c (gpgsm_get_key_algo_info): New. * sign.c (gpgsm_sign): Don't assume RSA in the status line. * keylist.c (list_cert_colon): Really print the algorithm and key length. (list_cert_raw, list_cert_std): Ditto. * gpgsm.h (opt): Add member CONFIG_FILENAME. * gpgsm.c (main): Use it here instead of the local var.
This commit is contained in:
parent
ac791c0a9a
commit
fdb1933917
6 changed files with 106 additions and 12 deletions
26
sm/keylist.c
26
sm/keylist.c
|
@ -296,6 +296,8 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity,
|
|||
char *fpr;
|
||||
ksba_isotime_t t;
|
||||
gpg_error_t valerr;
|
||||
int algo;
|
||||
unsigned int nbits;
|
||||
|
||||
if (ctrl->with_validation)
|
||||
valerr = gpgsm_validate_chain (ctrl, cert, NULL, 1, NULL, 0);
|
||||
|
@ -330,10 +332,8 @@ list_cert_colon (ctrl_t ctrl, ksba_cert_t cert, unsigned int validity,
|
|||
fputs (truststring, fp);
|
||||
|
||||
fpr = gpgsm_get_fingerprint_hexstring (cert, GCRY_MD_SHA1);
|
||||
fprintf (fp, ":%u:%d:%s:",
|
||||
/*keylen_of_cert (cert)*/1024,
|
||||
/* pubkey_algo_of_cert (cert)*/1,
|
||||
fpr+24);
|
||||
algo = gpgsm_get_key_algo_info (cert, &nbits);
|
||||
fprintf (fp, ":%u:%d:%s:", nbits, algo, fpr+24);
|
||||
|
||||
/* We assume --fixed-list-mode for gpgsm */
|
||||
ksba_cert_get_validity (cert, 0, t);
|
||||
|
@ -547,6 +547,14 @@ list_cert_raw (ctrl_t ctrl, ksba_cert_t cert, FILE *fp, int have_secret,
|
|||
s = get_oid_desc (oid, NULL);
|
||||
fprintf (fp, " hashAlgo: %s%s%s%s\n", oid, s?" (":"",s?s:"",s?")":"");
|
||||
|
||||
{
|
||||
const char *algoname;
|
||||
unsigned int nbits;
|
||||
|
||||
algoname = gcry_pk_algo_name (gpgsm_get_key_algo_info (cert, &nbits));
|
||||
fprintf (fp, " keyType: %u bit %s\n", nbits, algoname? algoname:"?");
|
||||
}
|
||||
|
||||
/* authorityKeyIdentifier */
|
||||
fputs (" authKeyId: ", fp);
|
||||
err = ksba_cert_get_auth_key_id (cert, NULL, &name, &sexp);
|
||||
|
@ -829,6 +837,16 @@ list_cert_std (ctrl_t ctrl, ksba_cert_t cert, FILE *fp, int have_secret,
|
|||
gpgsm_print_time (fp, t);
|
||||
putc ('\n', fp);
|
||||
|
||||
|
||||
{
|
||||
const char *algoname;
|
||||
unsigned int nbits;
|
||||
|
||||
algoname = gcry_pk_algo_name (gpgsm_get_key_algo_info (cert, &nbits));
|
||||
fprintf (fp, " key type: %u bit %s\n", nbits, algoname? algoname:"?");
|
||||
}
|
||||
|
||||
|
||||
err = ksba_cert_get_key_usage (cert, &kusage);
|
||||
if (gpg_err_code (err) != GPG_ERR_NO_DATA)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue