aboutsummaryrefslogtreecommitdiffstats
path: root/tests/gpgsm/t-verify.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <[email protected]>2003-04-28 23:59:03 +0000
committerMarcus Brinkmann <[email protected]>2003-04-28 23:59:03 +0000
commit30cdf132842cec187e428af413dbc2c8fafa341b (patch)
treedb677058ae833586200d7660791f39e776efc8fc /tests/gpgsm/t-verify.c
parent2003-04-28 Marcus Brinkmann <[email protected]> (diff)
downloadgpgme-30cdf132842cec187e428af413dbc2c8fafa341b.tar.gz
gpgme-30cdf132842cec187e428af413dbc2c8fafa341b.zip
doc/
2003-04-28 Marcus Brinkmann <[email protected]> * gpgme.texi (Verify): Rewritten to take into account new and deprecated functions and data types. gpgme/ 2003-04-28 Marcus Brinkmann <[email protected]> * gpgme.h (struct _gpgme_sig_notation): New structure. (GpgmeSigNotation): New type. (struct _gpgme_signature): New structure. (GpgmeSignature): New type. (struct _gpgme_op_verify_result): New structure. (GpgmeVerifyResult): New type. (gpgme_op_verify_result): New prototype. (gpgme_get_notation): Remove prototype. * ops.h (_gpgme_op_verify_init_result): New prototype. (_gpgme_verify_status_handler): Change first argument to void *. * util.h (_gpgme_decode_percent_string, _gpgme_map_gnupg_error): New prototypes. * conversion.c (_gpgme_decode_percent_string): New function. (gnupg_errors): New static global. (_gpgme_map_gnupg_error): New function. * gpgme.c (gpgme_release): Don't release CTX->notation. (gpgme_get_notation): Remove function. * decrypt-verify.c (_gpgme_op_decrypt_verify_start): Call _gpgme_op_verify_init_result. * verify.c: Do not include <stdio.h>, <assert.h> and "key.h", but do include "gpgme.h". (struct verify_result): Replace with ... (op_data_t): ... this type. (release_verify_result): Remove function. (release_op_data): New function. (is_token): Remove function. (skip_token): Remove function. (copy_token): Remove function. (gpgme_op_verify_result): New function. (calc_sig_summary): Rewritten. (finish_sig): Remove function. (parse_new_sig): New function. (parse_valid_sig): New function. (parse_notation): New function. (parse_trust): New function. (parse_error): New function. (_gpgme_verify_status_handler): Rewritten. Change first argument to void *. (_gpgme_op_verify_start): Rework error handling. Call _gpgme_op_verify_init_result. (gpgme_op_verify): Do not release or clear CTX->notation. (gpgme_get_sig_status): Rewritten. (gpgme_get_sig_string_attr): Likewise. (gpgme_get_sig_ulong_attr): Likewise. (gpgme_get_sig_key): Likewise.
Diffstat (limited to 'tests/gpgsm/t-verify.c')
-rw-r--r--tests/gpgsm/t-verify.c36
1 files changed, 32 insertions, 4 deletions
diff --git a/tests/gpgsm/t-verify.c b/tests/gpgsm/t-verify.c
index 0a48b3cb..282cf2b8 100644
--- a/tests/gpgsm/t-verify.c
+++ b/tests/gpgsm/t-verify.c
@@ -169,6 +169,8 @@ main (int argc, char **argv )
GpgmeError err;
GpgmeData sig, text;
GpgmeSigStat status;
+ GpgmeVerifyResult result;
+ GpgmeSigNotation notation;
char *nota;
int n = 0;
@@ -194,8 +196,21 @@ main (int argc, char **argv )
}
print_sig_stat (ctx, status);
- if ( (nota=gpgme_get_notation (ctx)) )
- printf ("---Begin Notation---\n%s---End Notation---\n", nota);
+ result = gpgme_op_verify_result (ctx);
+ notation = result->signatures->notations;
+ if (notation)
+ {
+ printf ("---Begin Notation---\n");
+ while (notation)
+ {
+ if (notation->name)
+ printf ("%s: %s\n", notation->name, notation->value);
+ else
+ printf ("Policy URL: %s\n", notation->value);
+ notation = notation->next;
+ }
+ printf ("---End Notation---\n");
+ }
puts ("checking a manipulated message:\n");
gpgme_data_release (text);
@@ -212,8 +227,21 @@ main (int argc, char **argv )
}
print_sig_stat (ctx, status);
- if ((nota=gpgme_get_notation (ctx)))
- printf ("---Begin Notation---\n%s---End Notation---\n", nota);
+ result = gpgme_op_verify_result (ctx);
+ notation = result->signatures->notations;
+ if (notation)
+ {
+ printf ("---Begin Notation---\n");
+ while (notation)
+ {
+ if (notation->name)
+ printf ("%s: %s\n", notation->name, notation->value);
+ else
+ printf ("Policy URL: %s\n", notation->value);
+ notation = notation->next;
+ }
+ printf ("---End Notation---\n");
+ }
gpgme_data_release (sig);
gpgme_data_release (text);