aboutsummaryrefslogtreecommitdiffstats
path: root/sm
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2007-12-06 15:55:03 +0000
committerWerner Koch <[email protected]>2007-12-06 15:55:03 +0000
commit89671cdd6425e0c2247bd02c7ce6bb2f6339f94d (patch)
treedf62d4ec104e82ffce7f163e357d3e9ab45d81c0 /sm
parentCreated help files form the current po entries. (diff)
downloadgnupg-89671cdd6425e0c2247bd02c7ce6bb2f6339f94d.tar.gz
gnupg-89671cdd6425e0c2247bd02c7ce6bb2f6339f94d.zip
More code for the audit log.
Diffstat (limited to 'sm')
-rw-r--r--sm/gpgsm.c2
-rw-r--r--sm/server.c10
-rw-r--r--sm/verify.c6
3 files changed, 13 insertions, 5 deletions
diff --git a/sm/gpgsm.c b/sm/gpgsm.c
index 21a29bee5..10e39159d 100644
--- a/sm/gpgsm.c
+++ b/sm/gpgsm.c
@@ -1676,7 +1676,7 @@ main ( int argc, char **argv)
if (auditlog)
{
- audit_print_result (ctrl.audit, auditfp);
+ audit_print_result (ctrl.audit, auditfp, 0);
audit_release (ctrl.audit);
ctrl.audit = NULL;
}
diff --git a/sm/server.c b/sm/server.c
index d54865ac9..e61f9d600 100644
--- a/sm/server.c
+++ b/sm/server.c
@@ -934,12 +934,15 @@ cmd_genkey (assuan_context_t ctx, char *line)
-/* GETAUDITLOG [--data]
+/* GETAUDITLOG [--data] [--html]
!!!WORK in PROGRESS!!!
If --data is used, the output is send using D-lines and not to the
source given by an OUTPUT command.
+
+ If --html is used the output is formated as an XHTML block. This is
+ designed to be incorporated into a HTML document.
*/
static int
cmd_getauditlog (assuan_context_t ctx, char *line)
@@ -947,10 +950,11 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
ctrl_t ctrl = assuan_get_pointer (ctx);
int out_fd;
estream_t out_stream;
- int opt_data;
+ int opt_data, opt_html;
int rc;
opt_data = has_option (line, "--data");
+ opt_html = has_option (line, "--html");
line = skip_options (line);
if (!ctrl->audit)
@@ -976,7 +980,7 @@ cmd_getauditlog (assuan_context_t ctx, char *line)
}
}
- audit_print_result (ctrl->audit, out_stream);
+ audit_print_result (ctrl->audit, out_stream, opt_html);
rc = 0;
es_fclose (out_stream);
diff --git a/sm/verify.c b/sm/verify.c
index b0ced0062..2a455a5ce 100644
--- a/sm/verify.c
+++ b/sm/verify.c
@@ -184,7 +184,10 @@ gpgsm_verify (ctrl_t ctrl, int in_fd, int data_fd, FILE *out_fp)
if (stopreason == KSBA_SR_NEED_HASH
|| stopreason == KSBA_SR_BEGIN_DATA)
- { /* We are now able to enable the hash algorithms */
+ {
+ audit_log (ctrl->audit, AUDIT_GOT_DATA);
+
+ /* We are now able to enable the hash algorithms */
for (i=0; (algoid=ksba_cms_get_digest_algo_list (cms, i)); i++)
{
algo = gcry_md_map_name (algoid);
@@ -535,6 +538,7 @@ gpgsm_verify (ctrl_t ctrl, int in_fd, int data_fd, FILE *out_fp)
xfree (buf);
}
+ audit_log_ok (ctrl->audit, AUDIT_CHAIN_STATUS, rc);
if (rc) /* of validate_chain */
{
log_error ("invalid certification chain: %s\n", gpg_strerror (rc));