From 91d3e5aa57bd9a75e77ddbd4753897b6a372c323 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Tue, 17 Feb 2004 17:26:20 +0000 Subject: [PATCH] * gpgsm/t-import.c (check_result): gpgsm does now return info in the result->imports; adjust for that. * gpgsm/Makefile.am (TESTS_ENVIRONMENT): Reset the GPG_AGENT_INFO. * gpg/t-keylist-sig.c (main): s/class/sig_class/. * gpg/t-signers.c (check_result): Ditto. * gpg/t-sign.c (check_result): Ditto. * gpg/t-encrypt-sign.c (check_result): Ditto. * gpgsm/t-sign.c (check_result): Ditto. --- NEWS | 4 ++++ tests/ChangeLog | 16 ++++++++++++++++ tests/gpg/t-decrypt-verify.c | 6 ++++++ tests/gpg/t-decrypt.c | 6 ++++++ tests/gpg/t-edit.c | 6 ++++++ tests/gpg/t-encrypt-sign.c | 10 ++++++++-- tests/gpg/t-encrypt-sym.c | 6 ++++++ tests/gpg/t-encrypt.c | 6 ++++++ tests/gpg/t-eventloop.c | 6 ++++++ tests/gpg/t-export.c | 6 ++++++ tests/gpg/t-genkey.c | 6 ++++++ tests/gpg/t-import.c | 6 ++++++ tests/gpg/t-keylist-sig.c | 20 +++++++++++++------- tests/gpg/t-keylist.c | 6 ++++++ tests/gpg/t-sign.c | 10 ++++++++-- tests/gpg/t-signers.c | 10 ++++++++-- tests/gpg/t-thread1.c | 6 ++++++ tests/gpg/t-trustlist.c | 6 ++++++ tests/gpg/t-verify.c | 6 ++++++ tests/gpgsm/Makefile.am | 2 +- tests/gpgsm/t-decrypt.c | 7 +++++++ tests/gpgsm/t-encrypt.c | 6 ++++++ tests/gpgsm/t-export.c | 6 ++++++ tests/gpgsm/t-genkey.c | 6 ++++++ tests/gpgsm/t-import.c | 17 ++++++++++++++++- tests/gpgsm/t-keylist.c | 6 ++++++ tests/gpgsm/t-sign.c | 10 ++++++++-- tests/gpgsm/t-verify.c | 6 ++++++ tests/t-data.c | 6 ++++++ 29 files changed, 203 insertions(+), 17 deletions(-) diff --git a/NEWS b/NEWS index 067cae68..5812dcfc 100644 --- a/NEWS +++ b/NEWS @@ -54,11 +54,15 @@ Noteworthy changes in version 0.4.5 (unreleased) needed. Still, it is there if necessary. If in doubt, contact us and we will give our advise for your specific situation. + * A new key listing mode for validation of the key has been added. + See the manual. + * Interface changes relative to the 0.4.4 release: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gpgme_data_seek_cb_t CHANGED: off_t is now a largefile type. gpgme_data_seek CHANGED: off_t is now a largefile type. gpgme_data_new_from_filepart CHANGED: off_t is now a largefile type. +GPGME_KEYLIST_MODE_VALIDATE NEW. Noteworthy changes in version 0.4.4 (2004-01-12) diff --git a/tests/ChangeLog b/tests/ChangeLog index f17e8123..e80cf7b6 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,3 +1,19 @@ +2004-02-17 Werner Koch + + * gpgsm/t-import.c (check_result): gpgsm does now return info in + the result->imports; adjust for that. + + * gpgsm/Makefile.am (TESTS_ENVIRONMENT): Reset the GPG_AGENT_INFO. + + Include config.h at the top of each C source. This is required + due to LFS support. + + * gpg/t-keylist-sig.c (main): s/class/sig_class/. + * gpg/t-signers.c (check_result): Ditto. + * gpg/t-sign.c (check_result): Ditto. + * gpg/t-encrypt-sign.c (check_result): Ditto. + * gpgsm/t-sign.c (check_result): Ditto. + 2004-01-12 Werner Koch * gpg/t-keylist-sig.c (main): Temporary disabled one test due top diff --git a/tests/gpg/t-decrypt-verify.c b/tests/gpg/t-decrypt-verify.c index 5cbfd0de..5cdfa073 100644 --- a/tests/gpg/t-decrypt-verify.c +++ b/tests/gpg/t-decrypt-verify.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-decrypt.c b/tests/gpg/t-decrypt.c index bfe05b29..c9f6eb16 100644 --- a/tests/gpg/t-decrypt.c +++ b/tests/gpg/t-decrypt.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-edit.c b/tests/gpg/t-edit.c index cefcbc41..fb69e549 100644 --- a/tests/gpg/t-edit.c +++ b/tests/gpg/t-edit.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-encrypt-sign.c b/tests/gpg/t-encrypt-sign.c index 19618c43..7885b62a 100644 --- a/tests/gpg/t-encrypt-sign.c +++ b/tests/gpg/t-encrypt-sign.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -59,10 +65,10 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) result->signatures->hash_algo); exit (1); } - if (result->signatures->class != 0) + if (result->signatures->sig_class != 0) { fprintf (stderr, "Wrong signature class reported: %u\n", - result->signatures->class); + result->signatures->sig_class); exit (1); } if (strcmp ("A0FF4590BB6122EDEF6E3C542D727CC768697734", diff --git a/tests/gpg/t-encrypt-sym.c b/tests/gpg/t-encrypt-sym.c index 29a3f47c..015ff196 100644 --- a/tests/gpg/t-encrypt-sym.c +++ b/tests/gpg/t-encrypt-sym.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-encrypt.c b/tests/gpg/t-encrypt.c index 756d216b..c1806680 100644 --- a/tests/gpg/t-encrypt.c +++ b/tests/gpg/t-encrypt.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-eventloop.c b/tests/gpg/t-eventloop.c index 1ffaea53..7b08ba89 100644 --- a/tests/gpg/t-eventloop.c +++ b/tests/gpg/t-eventloop.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-export.c b/tests/gpg/t-export.c index 44c48f93..ddac43e1 100644 --- a/tests/gpg/t-export.c +++ b/tests/gpg/t-export.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-genkey.c b/tests/gpg/t-genkey.c index 52bb99f2..09bbd1ea 100644 --- a/tests/gpg/t-genkey.c +++ b/tests/gpg/t-genkey.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-import.c b/tests/gpg/t-import.c index 4a304d88..b2c11aa7 100644 --- a/tests/gpg/t-import.c +++ b/tests/gpg/t-import.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-keylist-sig.c b/tests/gpg/t-keylist-sig.c index 9edaf032..41fa4af0 100644 --- a/tests/gpg/t-keylist-sig.c +++ b/tests/gpg/t-keylist-sig.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -43,7 +49,7 @@ struct char *name; char *comment; char *email; - unsigned int class; + unsigned int sig_class; int exportable; } sig; } uid[3]; @@ -405,10 +411,10 @@ main (int argc, char **argv) key->uids->signatures->email); exit (1); } - if (keys[i].uid[0].sig.class != key->uids->signatures->class) + if (keys[i].uid[0].sig.sig_class != key->uids->signatures->sig_class) { fprintf (stderr, "Unexpected class in first user ID sig: %i\n", - key->uids->signatures->class); + key->uids->signatures->sig_class); exit (1); } if (keys[i].uid[0].sig.exportable != key->uids->signatures->exportable) @@ -497,10 +503,10 @@ main (int argc, char **argv) key->uids->next->signatures->email); exit (1); } - if (keys[i].uid[1].sig.class != key->uids->next->signatures->class) + if (keys[i].uid[1].sig.sig_class != key->uids->next->signatures->sig_class) { fprintf (stderr, "Unexpected class in second user ID sig: %i\n", - key->uids->next->signatures->class); + key->uids->next->signatures->sig_class); exit (1); } if (keys[i].uid[1].sig.exportable != key->uids->next->signatures->exportable) @@ -586,10 +592,10 @@ main (int argc, char **argv) key->uids->next->next->signatures->email); exit (1); } - if (keys[i].uid[2].sig.class != key->uids->next->next->signatures->class) + if (keys[i].uid[2].sig.sig_class != key->uids->next->next->signatures->sig_class) { fprintf (stderr, "Unexpected class in third user ID sig: %i\n", - key->uids->next->next->signatures->class); + key->uids->next->next->signatures->sig_class); exit (1); } if (keys[i].uid[2].sig.exportable != key->uids->next->next->signatures->exportable) diff --git a/tests/gpg/t-keylist.c b/tests/gpg/t-keylist.c index 17c35edb..41332f6f 100644 --- a/tests/gpg/t-keylist.c +++ b/tests/gpg/t-keylist.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-sign.c b/tests/gpg/t-sign.c index 1b9d06d4..ae366ff9 100644 --- a/tests/gpg/t-sign.c +++ b/tests/gpg/t-sign.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -59,10 +65,10 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) result->signatures->hash_algo); exit (1); } - if (result->signatures->class != 1) + if (result->signatures->sig_class != 1) { fprintf (stderr, "Wrong signature class reported: %u\n", - result->signatures->class); + result->signatures->sig_class); exit (1); } if (strcmp ("A0FF4590BB6122EDEF6E3C542D727CC768697734", diff --git a/tests/gpg/t-signers.c b/tests/gpg/t-signers.c index f8288b49..199942ed 100644 --- a/tests/gpg/t-signers.c +++ b/tests/gpg/t-signers.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -66,10 +72,10 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) signature->hash_algo); exit (1); } - if (signature->class != 1) + if (signature->sig_class != 1) { fprintf (stderr, "Wrong signature class reported: %u\n", - signature->class); + signature->sig_class); exit (1); } if (strcmp ("A0FF4590BB6122EDEF6E3C542D727CC768697734", diff --git a/tests/gpg/t-thread1.c b/tests/gpg/t-thread1.c index 50549746..cc2e010f 100644 --- a/tests/gpg/t-thread1.c +++ b/tests/gpg/t-thread1.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-trustlist.c b/tests/gpg/t-trustlist.c index c8c82f82..677ecec0 100644 --- a/tests/gpg/t-trustlist.c +++ b/tests/gpg/t-trustlist.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpg/t-verify.c b/tests/gpg/t-verify.c index 0df8991d..bf0b8876 100644 --- a/tests/gpg/t-verify.c +++ b/tests/gpg/t-verify.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/Makefile.am b/tests/gpgsm/Makefile.am index 71984ff0..ad114a55 100644 --- a/tests/gpgsm/Makefile.am +++ b/tests/gpgsm/Makefile.am @@ -21,7 +21,7 @@ GPGSM = @GPGSM@ -TESTS_ENVIRONMENT = GNUPGHOME=. +TESTS_ENVIRONMENT = GNUPGHOME=. GPG_AGENT_INFO= noinst_HEADERS = t-support.h TESTS = t-import t-keylist t-encrypt t-verify t-decrypt t-sign t-export diff --git a/tests/gpgsm/t-decrypt.c b/tests/gpgsm/t-decrypt.c index ca5757dc..db507f0f 100644 --- a/tests/gpgsm/t-decrypt.c +++ b/tests/gpgsm/t-decrypt.c @@ -18,6 +18,13 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/t-encrypt.c b/tests/gpgsm/t-encrypt.c index ff61394b..a5c2dc1b 100644 --- a/tests/gpgsm/t-encrypt.c +++ b/tests/gpgsm/t-encrypt.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/t-export.c b/tests/gpgsm/t-export.c index ce7dadb8..f876de70 100644 --- a/tests/gpgsm/t-export.c +++ b/tests/gpgsm/t-export.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/t-genkey.c b/tests/gpgsm/t-genkey.c index a4d60c1e..0c67597c 100644 --- a/tests/gpgsm/t-genkey.c +++ b/tests/gpgsm/t-genkey.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/t-import.c b/tests/gpgsm/t-import.c index 43381569..82704922 100644 --- a/tests/gpgsm/t-import.c +++ b/tests/gpgsm/t-import.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -110,11 +116,20 @@ check_result (gpgme_import_result_t result, char *fpr, int total) result->not_imported); exit (1); } - if (result->imports) + + { + int n; + gpgme_import_status_t r; + + for (n=0, r=result->imports; r; r=r->next) + n++; + + if (n != total) { fprintf (stderr, "Unexpected number of status reports\n"); exit (1); } + } } diff --git a/tests/gpgsm/t-keylist.c b/tests/gpgsm/t-keylist.c index cf4073fc..3c38fa77 100644 --- a/tests/gpgsm/t-keylist.c +++ b/tests/gpgsm/t-keylist.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/gpgsm/t-sign.c b/tests/gpgsm/t-sign.c index 2cfac7da..406c72f4 100644 --- a/tests/gpgsm/t-sign.c +++ b/tests/gpgsm/t-sign.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include @@ -57,10 +63,10 @@ check_result (gpgme_sign_result_t result, gpgme_sig_mode_t type) result->signatures->hash_algo); exit (1); } - if (result->signatures->class != 0) + if (result->signatures->sig_class != 0) { fprintf (stderr, "Wrong signature class reported: %u\n", - result->signatures->class); + result->signatures->sig_class); exit (1); } if (strcmp ("3CF405464F66ED4A7DF45BBDD1E4282E33BDB76E", diff --git a/tests/gpgsm/t-verify.c b/tests/gpgsm/t-verify.c index 6fb32a94..19652e37 100644 --- a/tests/gpgsm/t-verify.c +++ b/tests/gpgsm/t-verify.c @@ -18,6 +18,12 @@ along with GPGME; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include diff --git a/tests/t-data.c b/tests/t-data.c index d7950ad2..8e61dba7 100644 --- a/tests/t-data.c +++ b/tests/t-data.c @@ -18,6 +18,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA */ +/* We need to include config.h so that we know whether we are building + with large file system (LFS) support. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include