Nice. Thanks. I'll try to wire the clearsign exerciser into LCOV/GCOV
"make check" in the next week or so ...
73 de Jeff
On May 24, 2008, at 12:47 PM, Ralf S. Engelschall wrote:
> RPM Package Manager, CVS Repository
> http://rpm5.org/cvs/
>
> ______________________________________________________________________
> ______
>
> Server: rpm5.org Name: Ralf S. Engelschall
> Root: /v/rpm/cvs Email: rse@rpm5.org
> Module: rpm Date: 24-May-2008
> 18:47:01
> Branch: HEAD Handle: 2008052416465902
>
> Modified files:
> rpm CHANGES configure.ac
> rpm/rpmio Makefile.am rpmgc.c
>
> Log:
> allow one to build against the GCrypt based crypto implementation
> out-of-the-box
>
> Summary:
> Revision Changes Path
> 1.2366 +1 -0 rpm/CHANGES
> 2.300 +8 -0 rpm/configure.ac
> 1.174 +2 -2 rpm/rpmio/Makefile.am
> 2.4 +38 -0 rpm/rpmio/rpmgc.c
>
> ______________________________________________________________________
> ______
>
> patch -p0 <<'@@ .'
> Index: rpm/CHANGES
>
> ======================================================================
> ======
> $ cvs diff -u -r1.2365 -r1.2366 CHANGES
> --- rpm/CHANGES 24 May 2008 16:44:52 -0000 1.2365
> +++ rpm/CHANGES 24 May 2008 16:46:59 -0000 1.2366
> @@ -1,5 +1,6 @@
>
> 5.1.0 -> 5.2a0:
> + - rse: allow one to build against the GCrypt based crypto
> implementation out-of-the-box
> - rse: more robust argument checking for CLI option --usecrypto
> - rse: add support for "lib<name>-config" and "lib<name>.pc"
> in RPM_CHECK_LIB
> - jbj: debuginfo: refactor 2 existing upgrade policy rules
> before
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/configure.ac
>
> ======================================================================
> ======
> $ cvs diff -u -r2.299 -r2.300 configure.ac
> --- rpm/configure.ac 24 May 2008 14:37:03 -0000 2.299
> +++ rpm/configure.ac 24 May 2008 16:46:59 -0000 2.300
> @@ -976,6 +976,14 @@
> [yes,external], [],
> [], [ AC_MSG_ERROR([mandatory BeeCrypt library not found]) ])
>
> +dnl # GCrypt
> +RPM_CHECK_LIB(
> + [GCrypt], [gcrypt],
> + [gcrypt], [gcry_pk_verify], [gcrypt.h],
> + [no,external], [],
> + [ AC_DEFINE(WITH_GCRYPT, 1, [Define if building with GCrypt])
> + ], [])
> +
> dnl # Mozilla NSS
> RPM_CHECK_LIB(
> [Mozilla NSS], [nss],
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/rpmio/Makefile.am
>
> ======================================================================
> ======
> $ cvs diff -u -r1.173 -r1.174 Makefile.am
> --- rpm/rpmio/Makefile.am 11 May 2008 12:36:45 -0000 1.173
> +++ rpm/rpmio/Makefile.am 24 May 2008 16:47:01 -0000 1.174
> @@ -56,7 +56,7 @@
>
> pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
> pkginc_HEADERS = \
> - argv.h envvar.h fts.h mire.h rpmbc.h rpmcb.h rpmdav.h \
> + argv.h envvar.h fts.h mire.h rpmbc.h rpmcb.h rpmdav.h rpmgc.h \
> rpmhash.h rpmio.h rpmio-stub.h rpmlog.h rpmmacro.h rpmmg.h \
> rpmnss.h rpmpgp.h rpmsq.h rpmssl.h rpmsw.h rpmurl.h rpmxar.h \
> stringbuf.h ugid.h rpmuuid.h
> @@ -72,7 +72,7 @@
> iosm.c lzdio.c macro.c mire.c mount.c \
> md2.c md4.c poptIO.c rmd128.c rmd160.c rmd256.c rmd320.c
> sha224.c \
> salsa10.c salsa20.c tiger.c \
> - rpmbc.c rpmdav.c rpmhash.c rpmhook.c rpmio.c rpmio-stub.c \
> + rpmbc.c rpmdav.c rpmgc.c rpmhash.c rpmhook.c rpmio.c rpmio-
> stub.c \
> rpmlog.c rpmlua.c rpmmalloc.c rpmmg.c rpmnss.c rpmpgp.c \
> rpmrpc.c rpmsq.c rpmssl.c rpmsw.c rpmxar.c \
> strcasecmp.c stringbuf.c strtolocale.c tar.c url.c ugid.c
> rpmuuid.c
> @@ .
> patch -p0 <<'@@ .'
> Index: rpm/rpmio/rpmgc.c
>
> ======================================================================
> ======
> $ cvs diff -u -r2.3 -r2.4 rpmgc.c
> --- rpm/rpmio/rpmgc.c 6 Dec 2007 01:50:48 -0000 2.3
> +++ rpm/rpmio/rpmgc.c 24 May 2008 16:47:01 -0000 2.4
> @@ -4,9 +4,15 @@
>
> #include "system.h"
> #include <rpmio.h>
> +
> #define _RPMGC_INTERNAL
> +#if defined(WITH_GCRYPT)
> #define _RPMPGP_INTERNAL
> #include <rpmgc.h>
> +#else
> +#include <rpmpgp.h> /* XXX DIGEST_CTX */
> +#endif
> +
> #include "debug.h"
>
> /*@access pgpDig @*/
> @@ -20,6 +26,7 @@
> extern int _pgp_print;
> /*@=redecl@*/
>
> +#if defined(WITH_GCRYPT)
> static
> void rpmgcDump(const char * msg, gcry_sexp_t sexp)
> {
> @@ -31,12 +38,14 @@
> fprintf(stderr, "========== %s:\n%s", msg, buf);
> return;
> }
> +#endif
>
> /**
> * Convert hex to binary nibble.
> * @param c hex character
> * @return binary nibble
> */
> +#if defined(WITH_GCRYPT)
> static
> unsigned char nibble(char c)
> /*@*/
> @@ -49,11 +58,13 @@
> return (unsigned char)((int)(c - 'a') + 10);
> return (unsigned char) '\0';
> }
> +#endif
>
> static
> int rpmgcSetRSA(/*@only@*/ DIGEST_CTX ctx, pgpDig dig,
> pgpDigParams sigp)
> /*@modifies ctx, dig @*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = dig->impl;
> unsigned int nbits = gcry_mpi_get_nbits(gc->c);
> unsigned int nb = (nbits + 7) >> 3;
> @@ -132,12 +143,16 @@
> signhash16[1] = (uint8_t) (nibble(s[2]) << 4) | nibble(s[3]);
> /*@=type@*/
> return memcmp(signhash16, sigp->signhash16, sizeof(sigp-
> >signhash16));
> +#else
> + return 0;
> +#endif
> }
>
> static
> int rpmgcVerifyRSA(pgpDig dig)
> /*@*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = dig->impl;
> gcry_error_t rc;
>
> @@ -166,12 +181,16 @@
> gcry_sexp_release(gc->sig); gc->sig = NULL;
>
> return (rc ? 0 : 1);
> +#else
> + return 0;
> +#endif
> }
>
> static
> int rpmgcSetDSA(/*@only@*/ DIGEST_CTX ctx, pgpDig dig,
> pgpDigParams sigp)
> /*@modifies ctx, dig @*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = dig->impl;
> gcry_error_t rc;
> int xx;
> @@ -189,12 +208,16 @@
>
> /* Compare leading 16 bits of digest for quick check. */
> return memcmp(dig->sha1, sigp->signhash16, sizeof(sigp-
> >signhash16));
> +#else
> + return 0;
> +#endif
> }
>
> static
> int rpmgcVerifyDSA(pgpDig dig)
> /*@*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = dig->impl;
> gcry_error_t rc;
>
> @@ -223,6 +246,9 @@
> gcry_sexp_release(gc->sig); gc->sig = NULL;
>
> return (rc ? 0 : 1);
> +#else
> + return 0;
> +#endif
> }
>
> static
> @@ -231,6 +257,7 @@
> /*@globals fileSystem @*/
> /*@modifies dig, fileSystem @*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = dig->impl;
> unsigned int nb;
> int rc = 0;
> @@ -296,12 +323,16 @@
> break;
> }
> return rc;
> +#else
> + return 1;
> +#endif
> }
>
> static
> void rpmgcClean(void * impl)
> /*@modifies impl @*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = impl;
> if (gc != NULL) {
> if (gc->sig) {
> @@ -353,17 +384,20 @@
> gc->y = NULL;
> }
> }
> +#endif
> }
>
> static
> void * rpmgcFree(/*@only@*/ void * impl)
> /*@modifies impl @*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = impl;
> if (gc != NULL) {
> rpmgcClean(impl);
> gc = _free(gc);
> }
> +#endif
> return NULL;
> }
>
> @@ -371,8 +405,12 @@
> void * rpmgcInit(void)
> /*@*/
> {
> +#if defined(WITH_GCRYPT)
> rpmgc gc = xcalloc(1, sizeof(*gc));
> return (void *) gc;
> +#else
> + return NULL;
> +#endif
> }
>
> struct pgpImplVecs_s rpmgcImplVecs = {
> @@ .
> ______________________________________________________________________
> RPM Package Manager http://rpm5.org
> CVS Sources Repository rpm-cvs@rpm5.org
Received on Sat May 24 18:56:41 2008