aboutsummaryrefslogtreecommitdiffstats
path: root/sm/certpath.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2002-02-18 20:47:29 +0000
committerWerner Koch <[email protected]>2002-02-18 20:47:29 +0000
commit5dac4711f9a70fd22abad2569521eac657893e85 (patch)
treedf737a8cbff65a15dfe5684a2c92fb7253ef0027 /sm/certpath.c
parentSome experimental code - don't use it. (diff)
downloadgnupg-5dac4711f9a70fd22abad2569521eac657893e85.tar.gz
gnupg-5dac4711f9a70fd22abad2569521eac657893e85.zip
* certpath.c (gpgsm_validate_path): Ask the agent to add the
certificate into the trusted list. * call-agent.c (gpgsm_agent_marktrusted): New.
Diffstat (limited to 'sm/certpath.c')
-rw-r--r--sm/certpath.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/sm/certpath.c b/sm/certpath.c
index 842481bfc..e76ff6c2f 100644
--- a/sm/certpath.c
+++ b/sm/certpath.c
@@ -261,17 +261,27 @@ gpgsm_validate_path (KsbaCert cert)
;
else if (rc == GNUPG_Not_Trusted)
{
+ int rc2;
+
char *fpr = gpgsm_get_fingerprint_string (subject_cert,
GCRY_MD_SHA1);
- log_error (_("root certificate is not marked trusted\n"));
+ log_info (_("root certificate is not marked trusted\n"));
log_info (_("fingerprint=%s\n"), fpr? fpr : "?");
xfree (fpr);
- /* fixme: print a note while we have not yet the code to
- ask whether the cert should be entered into the trust
- list */
- gpgsm_dump_cert ("issuer", subject_cert);
- log_info ("after checking the fingerprint, you may want "
- "to enter it into \"~/.gnupg-test/trustlist.txt\"\n");
+ rc2 = gpgsm_agent_marktrusted (subject_cert);
+ if (!rc2)
+ {
+ log_info (_("root certificate has now"
+ " been marked as trusted\n"));
+ rc = 0;
+ }
+ else
+ {
+ gpgsm_dump_cert ("issuer", subject_cert);
+ log_info ("after checking the fingerprint, you may want "
+ "to enter it manually into "
+ "\"~/.gnupg-test/trustlist.txt\"\n");
+ }
}
else
{