RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [email protected] Module: rpm Date: 28-Apr-2010 19:25:57 Branch: rpm-5_1 Handle: 2010042817255601 Added files: (Branch: rpm-5_1) rpm/tests genpgp.h tpgp.c rpm/tests/ref DB_CONFIG Log: - tests: "make check" for RHEL6 beta passes. - backport "make check" sufficient to verify signatures. Summary: Revision Changes Path 1.1.4.2 +13 -0 rpm/tests/genpgp.h 1.1.6.2 +39 -0 rpm/tests/ref/DB_CONFIG 1.1.6.2 +77 -0 rpm/tests/tpgp.c ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/tests/genpgp.h ============================================================================ $ cvs diff -u -r0 -r1.1.4.2 genpgp.h --- /dev/null 2010-04-28 19:25:50.000000000 +0200 +++ genpgp.h 2010-04-28 19:25:57.137976487 +0200 @@ -0,0 +1,13 @@ +static const char * plaintextfn = "/X/src/wdj51/tests/tmp/plaintext"; +static const char * DSAsig = "/X/src/wdj51/tests/tmp/DSA.sig"; +static const char * DSAsigpem = "/X/src/wdj51/tests/tmp/DSA.sigpem"; +static const char * DSApem = "/X/src/wdj51/tests/tmp/DSA.pem"; +static const char * DSApub = "/X/src/wdj51/tests/tmp/DSA.pub"; +static const char * DSApubpem = "/X/src/wdj51/tests/tmp/DSA.pubpem"; +static const char * DSApubid = ""; +static const char * RSAsig = "/X/src/wdj51/tests/tmp/RSA.sig"; +static const char * RSAsigpem = "/X/src/wdj51/tests/tmp/RSA.sigpem"; +static const char * RSApem = "/X/src/wdj51/tests/tmp/RSA.pem"; +static const char * RSApub = "/X/src/wdj51/tests/tmp/RSA.pub"; +static const char * RSApubpem = "/X/src/wdj51/tests/tmp/RSA.pubpem"; +static const char * RSApubid = ""; @@ . patch -p0 <<'@@ .' Index: rpm/tests/ref/DB_CONFIG ============================================================================ $ cvs diff -u -r0 -r1.1.6.2 DB_CONFIG --- /dev/null 2010-04-28 19:25:50.000000000 +0200 +++ DB_CONFIG 2010-04-28 19:25:57.447992829 +0200 @@ -0,0 +1,39 @@ +# ================ Environment +#add_data_dir . +set_data_dir . +#set_create_dir . +set_lg_dir ./log +set_tmp_dir ./tmp + +# -- thread_count must be >= 8 +#set_thread_count 64 + +#set_verbose DB_VERB_DEADLOCK +#set_verbose DB_VERB_FILEOPS +#set_verbose DB_VERB_FILEOPS_ALL +#set_verbose DB_VERB_RECOVERY +#set_verbose DB_VERB_REGISTER +#set_verbose DB_VERB_REPLICATION +#set_verbose DB_VERB_REP_ELECT +#set_verbose DB_VERB_REP_LEASE +#set_verbose DB_VERB_REP_MISC +#set_verbose DB_VERB_REP_MSGS +#set_verbose DB_VERB_REP_SYNC +#set_verbose DB_VERB_REP_TEST +#set_verbose DB_VERB_REPMGR_CONNFAIL +#set_verbose DB_VERB_REPMGR_MISC +#set_verbose DB_VERB_WAITSFOR + +# ================ Logging + +# ================ Memory Pool +#XXX initializing dbenv with set_cachesize has unimplemented prerequsites +#set_cachesize 0 67108864 4 +set_mp_mmapsize 268435456 + +# ================ Locking +set_lk_max_locks 8000 +set_lk_max_lockers 8000 +set_lk_max_objects 8000 + +# ================ Replication @@ . patch -p0 <<'@@ .' Index: rpm/tests/tpgp.c ============================================================================ $ cvs diff -u -r0 -r1.1.6.2 tpgp.c --- /dev/null 2010-04-28 19:25:50.000000000 +0200 +++ tpgp.c 2010-04-28 19:25:57.167978086 +0200 @@ -0,0 +1,77 @@ +/** + * \file lib/tpgp.c + * Test RFC-4880 clearsigned and detached signatures. + */ + +extern int _pgp_debug; +extern int _pgp_print; + +#include "system.h" + +#include <rpmio.h> +#include <rpmns.h> +#include <rpmcli.h> + +#include "genpgp.h" + +#include "debug.h" + +static +rpmRC doit(rpmts ts, const char * sigtype) +{ + rpmRC rc = RPMRC_FAIL; + + if (!strcmp("DSA", sigtype)) { + rc = rpmnsProbeSignature(ts, DSApem, NULL, DSApub, DSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsig, DSApub, DSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsig, DSApubpem, DSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsigpem, DSApub, DSApubid, 0); + + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsigpem, DSApubpem, DSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsig, NULL, DSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, DSAsigpem, NULL, DSApubid, 0); + } + + if (!strcmp("RSA", sigtype)) { + rc = rpmnsProbeSignature(ts, RSApem, NULL, RSApub, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsig, RSApub, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsigpem, RSApubpem, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsigpem, RSApub, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsigpem, RSApubpem, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsig, NULL, RSApubid, 0); + rc = rpmnsProbeSignature(ts, plaintextfn, RSAsigpem, NULL, RSApubid, 0); + } + + return rc; +} + +static struct poptOption optionsTable[] = { + { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmcliAllPoptTable, 0, + N_("Common options:"), + NULL }, + + POPT_AUTOALIAS + POPT_AUTOHELP + POPT_TABLEEND +}; + +int +main(int argc, char *argv[]) +{ + poptContext optCon = rpmcliInit(argc, argv, optionsTable); + rpmts ts = rpmtsCreate(); + int rc = rpmtsOpenDB(ts, O_RDONLY); + +fprintf(stderr, " DSA"); + rc = doit(ts, "DSA"); +fprintf(stderr, " RSA"); + rc = doit(ts, "RSA"); +fprintf(stderr, "\n"); + + (void) rpmtsFree(ts); + ts = NULL; + + optCon = rpmcliFini(optCon); + + return rc; +} @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository [email protected]
