From d94faf4a3d4daf6be1d732b226a4d6468dbf0f4f Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 25 Sep 2006 18:29:20 +0000 Subject: New "relax" option for trustlist.txt --- sm/call-agent.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'sm/call-agent.c') diff --git a/sm/call-agent.c b/sm/call-agent.c index 2ab52ab7c..35ad1b83b 100644 --- a/sm/call-agent.c +++ b/sm/call-agent.c @@ -494,15 +494,36 @@ gpgsm_agent_readkey (ctrl_t ctrl, const char *hexkeygrip, } + +static int +istrusted_status_cb (void *opaque, const char *line) +{ + struct rootca_flags_s *flags = opaque; + + if (!strncmp (line, "TRUSTLISTFLAG", 13) && (line[13]==' ' || !line[13])) + { + for (line += 13; *line == ' '; line++) + ; + if (!strncmp (line, "relax", 5) && (line[5] == ' ' || !line[5])) + flags->relax = 1; + } + return 0; +} + + + /* Ask the agent whether the certificate is in the list of trusted - keys */ + keys. ROOTCA_FLAGS is guaranteed to be cleared on error. */ int -gpgsm_agent_istrusted (ctrl_t ctrl, ksba_cert_t cert) +gpgsm_agent_istrusted (ctrl_t ctrl, ksba_cert_t cert, + struct rootca_flags_s *rootca_flags) { int rc; char *fpr; char line[ASSUAN_LINELENGTH]; + memset (rootca_flags, 0, sizeof *rootca_flags); + rc = start_agent (ctrl); if (rc) return rc; @@ -518,7 +539,8 @@ gpgsm_agent_istrusted (ctrl_t ctrl, ksba_cert_t cert) line[DIM(line)-1] = 0; xfree (fpr); - rc = assuan_transact (agent_ctx, line, NULL, NULL, NULL, NULL, NULL, NULL); + rc = assuan_transact (agent_ctx, line, NULL, NULL, NULL, NULL, + istrusted_status_cb, rootca_flags); return rc; } -- cgit v1.2.3