mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-02 12:01:32 +01:00
sm: Print a better diagnostic for encryption certificate selection.
* sm/certlist.c (gpgsm_add_to_certlist): Add diagnostic and fold two similar branches. -- Without this patch gpgsm printed: gpgsm[23045]: DBG: chan_6 <- RECIPIENT edward.tester@demo.gnupg.com gpgsm[23045]: certificate is not usable for encryption gpgsm[23045]: certificate is good with this patch a gpgsm[23045]: looking for another certificate is inserted into the log. Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
parent
537fbe13af
commit
9bf650db02
@ -352,19 +352,14 @@ gpgsm_add_to_certlist (ctrl_t ctrl, const char *name, int secret,
|
|||||||
{
|
{
|
||||||
/* There might be another certificate with the
|
/* There might be another certificate with the
|
||||||
correct usage, so we try again */
|
correct usage, so we try again */
|
||||||
if (!wrong_usage)
|
if (!wrong_usage
|
||||||
{ /* save the first match */
|
|| same_subject_issuer (first_subject, first_issuer,cert))
|
||||||
wrong_usage = rc;
|
|
||||||
ksba_cert_release (cert);
|
|
||||||
cert = NULL;
|
|
||||||
goto get_next;
|
|
||||||
}
|
|
||||||
else if (same_subject_issuer (first_subject, first_issuer,
|
|
||||||
cert))
|
|
||||||
{
|
{
|
||||||
wrong_usage = rc;
|
if (!wrong_usage)
|
||||||
|
wrong_usage = rc; /* save error of the first match */
|
||||||
ksba_cert_release (cert);
|
ksba_cert_release (cert);
|
||||||
cert = NULL;
|
cert = NULL;
|
||||||
|
log_info (_("looking for another certificate\n"));
|
||||||
goto get_next;
|
goto get_next;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user