mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
Support DSA2.
Support Camellia for testing. More audit stuff.
This commit is contained in:
parent
c8b76e5621
commit
bae4b256c7
34 changed files with 682 additions and 174 deletions
47
sm/gpgsm.c
47
sm/gpgsm.c
|
@ -848,6 +848,7 @@ main ( int argc, char **argv)
|
|||
certlist_t signerlist = NULL;
|
||||
int do_not_setup_keys = 0;
|
||||
int recp_required = 0;
|
||||
estream_t auditfp = NULL;
|
||||
|
||||
/*mtrace();*/
|
||||
|
||||
|
@ -1482,6 +1483,26 @@ main ( int argc, char **argv)
|
|||
keydb_add_resource (sl->d, 0, 0, NULL);
|
||||
FREE_STRLIST(nrings);
|
||||
|
||||
|
||||
/* Prepare the audit log feature for certain commands. */
|
||||
if (auditlog)
|
||||
{
|
||||
switch (cmd)
|
||||
{
|
||||
case aEncr:
|
||||
case aSign:
|
||||
case aDecrypt:
|
||||
case aVerify:
|
||||
audit_release (ctrl.audit);
|
||||
ctrl.audit = audit_new ();
|
||||
auditfp = open_es_fwrite (auditlog);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!do_not_setup_keys)
|
||||
{
|
||||
for (sl = locusr; sl ; sl = sl->next)
|
||||
|
@ -1528,6 +1549,7 @@ main ( int argc, char **argv)
|
|||
|
||||
fname = argc? *argv : NULL;
|
||||
|
||||
/* Dispatch command. */
|
||||
switch (cmd)
|
||||
{
|
||||
case aGPGConfList:
|
||||
|
@ -1650,7 +1672,6 @@ main ( int argc, char **argv)
|
|||
case aVerify:
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
estream_t auditfp = NULL;
|
||||
|
||||
set_binary (stdin);
|
||||
if (argc == 2 && opt.outfile)
|
||||
|
@ -1658,13 +1679,6 @@ main ( int argc, char **argv)
|
|||
else if (opt.outfile)
|
||||
fp = open_fwrite (opt.outfile);
|
||||
|
||||
if (auditlog)
|
||||
{
|
||||
audit_release (ctrl.audit);
|
||||
ctrl.audit = audit_new ();
|
||||
auditfp = open_es_fwrite (auditlog);
|
||||
}
|
||||
|
||||
if (!argc)
|
||||
gpgsm_verify (&ctrl, 0, -1, fp); /* normal signature from stdin */
|
||||
else if (argc == 1)
|
||||
|
@ -1674,16 +1688,8 @@ main ( int argc, char **argv)
|
|||
else
|
||||
wrong_args ("--verify [signature [detached_data]]");
|
||||
|
||||
if (auditlog)
|
||||
{
|
||||
audit_print_result (ctrl.audit, auditfp, 0);
|
||||
audit_release (ctrl.audit);
|
||||
ctrl.audit = NULL;
|
||||
}
|
||||
|
||||
if (fp && fp != stdout)
|
||||
fclose (fp);
|
||||
es_fclose (auditfp);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1846,6 +1852,15 @@ main ( int argc, char **argv)
|
|||
log_error ("invalid command (there is no implicit command)\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* Print the audit result if needed. */
|
||||
if (auditlog && auditfp)
|
||||
{
|
||||
audit_print_result (ctrl.audit, auditfp, 0);
|
||||
audit_release (ctrl.audit);
|
||||
ctrl.audit = NULL;
|
||||
es_fclose (auditfp);
|
||||
}
|
||||
|
||||
/* cleanup */
|
||||
gpgsm_release_certlist (recplist);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue