RPM Community Forums

Mailing List Message of <rpm-devel>

Re: [CVS] RPM: rpm/ CHANGES configure.ac rpm/rpmio/ rpmpgp.c

From: Jeff Johnson <n3npq@mac.com>
Date: Sat 24 May 2008 - 18:59:02 CEST
Message-id: <E45F1674-B7AA-46D7-8BD8-F3490CD7E672@mac.com>
Nothing wrong with this change, but likely needs to be done as
a macro persistently at run-time so that the --usecrypto
doesn't have to be explictly added to each invocation when multiple
implementations are present.

And dlopen() eventually to Have it yer own way! AutoFu
choice is restrictive: if not compiled in, well, that crypto
implementation is unavailable. Period.

Again, nothing at all wrong with the patch ...

73 de Jeff
On May 24, 2008, at 12:53 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:53:30
>   Branch: HEAD                             Handle: 2008052416532900
>
>   Modified files:
>     rpm                     CHANGES configure.ac
>     rpm/rpmio               rpmpgp.c
>
>   Log:
>     1. implicitly choose one of BeeCrypt/GCrypt/NSS/OpenSSL as the  
> crypto
>        implementation
>     2. add an Autoconf --with-usecrypto={beecrypt,gcrypt,nss,openssl}
>        build-time option
>     3. explicitly let one to force one of BeeCrypt/GCrypt/NSS/ 
> OpenSSL as the
>        crypto implementation via Autoconf option --with-usecrypto.
>
>   Summary:
>     Revision    Changes     Path
>     1.2367      +3  -0      rpm/CHANGES
>     2.301       +15 -0      rpm/configure.ac
>     2.91        +18 -2      rpm/rpmio/rpmpgp.c
>    
> ______________________________________________________________________ 
> ______
>
>   patch -p0 <<'@@ .'
>   Index: rpm/CHANGES
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r1.2366 -r1.2367 CHANGES
>   --- rpm/CHANGES	24 May 2008 16:46:59 -0000	1.2366
>   +++ rpm/CHANGES	24 May 2008 16:53:29 -0000	1.2367
>   @@ -1,5 +1,8 @@
>
>    5.1.0 -> 5.2a0:
>   +    - rse: explicitly let one to force one of BeeCrypt/GCrypt/ 
> NSS/OpenSSL as the crypto implementation
>   +    - rse: implicitly choose one of BeeCrypt/GCrypt/NSS/OpenSSL  
> as the crypto implementation
>   +    - rse: add an Autoconf --with-usecrypto= 
> {beecrypt,gcrypt,nss,openssl} build-time option
>        - 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
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/configure.ac
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.300 -r2.301 configure.ac
>   --- rpm/configure.ac	24 May 2008 16:46:59 -0000	2.300
>   +++ rpm/configure.ac	24 May 2008 16:53:29 -0000	2.301
>   @@ -999,6 +999,21 @@
>        [ AC_DEFINE(WITH_SSL, 1, [Define if building with OpenSSL])
>        ], [])
>
>   +dnl # select default Cryptography implementation to use (default  
> for CLI option --usecrypto)
>   +AC_ARG_WITH([usecrypto],
>   +    AS_HELP_STRING(
>   +        [--with-usecrypto=ID],
>   +        [use particular default for --usecrypto option  
> ("beecrypt", "gcrypt", "nss", "openssl")]
>   +    ), [
>   +    case "`echo $withval | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'  
> 'abcdefghijklmnopqrstuvwxyz'`" in
>   +        beecrypt | bc ) AC_DEFINE(USE_CRYPTO_BEECRYPT, 1,  
> [Define to 1 for using BeeCrypt    as default cryptography  
> library]) ;;
>   +        gcrypt   | gc ) AC_DEFINE(USE_CRYPTO_GCRYPT,   1,  
> [Define to 1 for using GCrypt      as default cryptography  
> library]) ;;
>   +        nss           ) AC_DEFINE(USE_CRYPTO_NS,       1,  
> [Define to 1 for using Mozilla NSS as default cryptography  
> library]) ;;
>   +        openssl | ssl ) AC_DEFINE(USE_CRYPTO_OPENSSL,  1,  
> [Define to 1 for using OpenSSL     as default cryptography  
> library]) ;;
>   +        * ) AC_MSG_ERROR([invalid cryptography library  
> identifier specified for --with-usecrypto option]) ;;
>   +    esac
>   +])
>   +
>    dnl # Neon
>    RPM_CHECK_LIB(
>        [Neon], [neon],
>   @@ .
>   patch -p0 <<'@@ .'
>   Index: rpm/rpmio/rpmpgp.c
>    
> ====================================================================== 
> ======
>   $ cvs diff -u -r2.90 -r2.91 rpmpgp.c
>   --- rpm/rpmio/rpmpgp.c	17 Mar 2008 09:50:02 -0000	2.90
>   +++ rpm/rpmio/rpmpgp.c	24 May 2008 16:53:29 -0000	2.91
>   @@ -24,10 +24,26 @@
>
>    /*@unchecked@*/
>    pgpImplVecs_t * pgpImplVecs =
>   -#if defined(WITH_NSS)
>   +    /* explicit selection (order DOES NOT matter here) */
>   +#if defined(USE_CRYPTO_BEECRYPT) && defined(WITH_BEECRYPT)
>   +	&rpmbcImplVecs;
>   +#elif defined(USE_CRYPTO_GCRYPT) && defined(WITH_GCRYPT)
>   +	&rpmgcImplVecs;
>   +#elif defined(USE_CRYPTO_NSS) && defined(WITH_NSS)
>    	&rpmnssImplVecs;
>   -#else
>   +#elif defined(USE_CRYPTO_OPENSSL) && defined(WITH_SSL)
>   +	&rpmsslImplVecs;
>   +    /* implict selection (order DOES matter) */
>   +#elif defined(WITH_BEECRYPT)
>    	&rpmbcImplVecs;
>   +#elif defined(WITH_GCRYPT)
>   +	&rpmgcImplVecs;
>   +#elif defined(WITH_NSS)
>   +	&rpmnssImplVecs;
>   +#elif defined(WITH_SSL)
>   +	&rpmsslImplVecs;
>   +#else
>   +#error INTERNAL ERROR: no suitable Cryptography library available
>    #endif
>
>    /*@unchecked@*/ /*@refcounted@*/ /*@relnull@*/
>   @@ .
> ______________________________________________________________________
> RPM Package Manager                                    http://rpm5.org
> CVS Sources Repository                                rpm-cvs@rpm5.org
Received on Sat May 24 19:01:15 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.