[CVS] RPM: rpm/ VENDOR rpm/build/ parsePreamble.c

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 10:57:58
  Branch: HEAD Handle: 2007122809575800

  Modified files:
rpm VENDOR
rpm/build   parsePreamble.c

  Log:
remove this OpenPKG-specific hack now that we have macro stack
expansion

  Summary:
RevisionChanges Path
2.21+0  -10 rpm/VENDOR
2.167   +0  -11 rpm/build/parsePreamble.c
  

  patch -p0 <<'@@ .'
  Index: rpm/VENDOR
  
  $ cvs diff -u -r2.20 -r2.21 VENDOR
  --- rpm/VENDOR27 Dec 2007 15:32:31 -  2.20
  +++ rpm/VENDOR28 Dec 2007 09:57:58 -  2.21
  @@ -338,14 +338,4 @@
arbitrary (or else the macro would be not available).
Hint:   As %_arbitrary_tags restricts the allowed tags anyway,
best would be to export also arbitrary tags as macros!
  - 
  -
  - Change: append-tag-value-to-macro
  - Purpose:Instead of overwriting macro "foo" with the latest
  - value "quux" in case of tag "Foo: bar" followed
  - by tag "Foo: quux", set the macro "foo" to the
  - comma-separated list "bar, quux".
  - Reason: This allows one to get the values of all(!) tags
  - instead of just the last one. In OpenPKG we use this
  - to fetch the value of tags like BuildPreReq or NoSource.
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/build/parsePreamble.c
  
  $ cvs diff -u -r2.166 -r2.167 parsePreamble.c
  --- rpm/build/parsePreamble.c 27 Dec 2007 15:32:32 -  2.166
  +++ rpm/build/parsePreamble.c 28 Dec 2007 09:57:58 -  2.167
  @@ -810,18 +810,7 @@
   }
   
   if (macro)
  -#if defined(RPM_VENDOR_OPENPKG) /* append-tag-value-to-macro */
  -{
  -char *value = rpmExpand("%{?", macro, ":%{", macro, "}, }", NULL);
  -size_t value_len = strlen(value);
  -value = xrealloc(value, value_len + strlen(field) + 1);
  -strcpy(value+value_len, field);
  -addMacro(spec->macros, macro, NULL, value, RMIL_SPEC);
  -value = _free(value);
  -}
  -#else
addMacro(spec->macros, macro, NULL, field, RMIL_SPEC);
  -#endif
   
   return RPMRC_OK;
   }
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ INSTALL devtool.conf

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 11:03:01
  Branch: HEAD Handle: 200712281003

  Modified files:
rpm INSTALL devtool.conf

  Log:
switch to latest File 4.22

  Summary:
RevisionChanges Path
2.68+1  -1  rpm/INSTALL
2.154   +1  -1  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/INSTALL
  
  $ cvs diff -u -r2.67 -r2.68 INSTALL
  --- rpm/INSTALL   15 Dec 2007 08:56:01 -  2.67
  +++ rpm/INSTALL   28 Dec 2007 10:03:00 -  2.68
  @@ -39,7 +39,7 @@
   ZLib[3] optional  1.2 1.2.3   http://www.zlib.net/
   Bzip2   optional  1.0 1.0.4   http://www.bzip.org/
   LZMA SDK[4] internal  4.274.32http://www.7-zip.org/sdk.html
  -File/magic  [5] optional  4.0 4.21ftp://ftp.astron.com/pub/file/
  +File/magic  [5] optional  4.0 4.22ftp://ftp.astron.com/pub/file/
   GNU gettext optional  0.160.17
http://www.gnu.org/software/gettext/
   GNU iconv   optional  1.111.11
http://www.gnu.org/software/libiconv/
   PCREoptional  7.0 7.4 http://www.pcre.org/
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.153 -r2.154 devtool.conf
  --- rpm/devtool.conf  27 Dec 2007 20:24:16 -  2.153
  +++ rpm/devtool.conf  28 Dec 2007 10:03:00 -  2.154
  @@ -222,7 +222,7 @@
   v_db="4.6.21"
   v_sqlite="3.5.4"
   v_lua="5.1.2"
  -v_file="4.21"
  +v_file="4.22"
   v_popt="1.13"
   v_libxml2="2.6.30"
   v_xar="1.5.1"
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/rpmdb/ rpmtag.h

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 11:05:56
  Branch: HEAD Handle: 2007122810055600

  Modified files:
rpm/rpmdb   rpmtag.h

  Log:
Class really should be a non-arbitrary tag

  Summary:
RevisionChanges Path
1.34+1  -1  rpm/rpmdb/rpmtag.h
  

  patch -p0 <<'@@ .'
  Index: rpm/rpmdb/rpmtag.h
  
  $ cvs diff -u -r1.33 -r1.34 rpmtag.h
  --- rpm/rpmdb/rpmtag.h18 Dec 2007 19:40:54 -  1.33
  +++ rpm/rpmdb/rpmtag.h28 Dec 2007 10:05:56 -  1.34
  @@ -405,7 +405,7 @@
   RPMTAG_RPMLIBVERSION = 1199, /* i */
   RPMTAG_RPMLIBTIMESTAMP   = 1200, /* i */
   RPMTAG_RPMLIBVENDOR  = 1201, /* i */
  -RPMTAG_CLASS = 1202, /* s internal arbitrary */
  +RPMTAG_CLASS = 1202, /* s */
   RPMTAG_TRACK = 1203, /* s internal arbitrary */
   RPMTAG_TRACKPROG = 1204, /* s internal arbitrary */
   RPMTAG_SANITYCHECK   = 1205, /* s */
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ devtool.conf

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 11:09:36
  Branch: HEAD Handle: 2007122810093600

  Modified files:
rpm devtool.conf

  Log:
hack in universal cpu-os macros for darwin (before it was using i386
on ppc)

  Summary:
RevisionChanges Path
2.155   +24 -0  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.154 -r2.155 devtool.conf
  --- rpm/devtool.conf  28 Dec 2007 10:03:00 -  2.154
  +++ rpm/devtool.conf  28 Dec 2007 10:09:36 -  2.155
  @@ -1882,6 +1882,30 @@
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc64
   
  +if [ ".$UNIVERSAL_SDK" != "." ]; then
  +# setup architectures
  +for ARCH in ppc i386; do
  +mkdir -p /tmp/rpm-root/usr/local/lib/rpm/$ARCH-darwin
  +sed -e "s/^%/%/" <<__EOF__ 
>/tmp/rpm-root/usr/local/lib/rpm/$ARCH-darwin/macros
  +# Per-platform rpm configuration file.
  +
  
+#==
  +#  per-platform macros.
  +#
  +\%_arch  $ARCH
  +\%_build_arch$ARCH
  +\%_vendorapple
  +\%_osdarwin
  +\%_gnu   %{nil}
  +\%_target_platform   %{_target_cpu}-%{_vendor}-%{_target_os}
  +\%optflags   -O2 -g
  +
  +__EOF__
  +done
  +perl -pi -e 
"s/^\%_arch.*/\%_arch\t\t\tfat/g;s/^\%_build_arch.*/\%_build_arch\t\tfat/g" \
  +/tmp/rpm-root/usr/local/lib/rpm/macros
  +fi
  +
   # copy required popt.h library header to internal headers
   cp -p "$basemac/bin/popt-${v_popt}/popt.h" 
/tmp/rpm-root/usr/local/include/rpm
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ NEWS

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 11:50:29
  Branch: HEAD Handle: 2007122810502900

  Modified files:
rpm NEWS

  Log:
remember a few additional visible things

  Summary:
RevisionChanges Path
2.12+5  -0  rpm/NEWS
  

  patch -p0 <<'@@ .'
  Index: rpm/NEWS
  
  $ cvs diff -u -r2.11 -r2.12 NEWS
  --- rpm/NEWS  17 Dec 2007 08:12:22 -  2.11
  +++ rpm/NEWS  28 Dec 2007 10:50:29 -  2.12
  @@ -123,6 +123,11 @@
   
 o Additional Specification Features:
   FIXME: Class, %track+vcheck, %sanitycheck
  +FIXME: arbitrary tag support
  +FIXME: %{@:} macro stack expansion
  +
  +  o Additional CLI Features:
  +FIXME: rpm -bt for %track execution
   
 o Application Programming Interface (API) Changes:
   FIXME: << JBJ: please add details! >>
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ NEWS

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 11:50:46
  Branch: HEAD Handle: 2007122810504500

  Modified files:
rpm NEWS

  Log:
remember a few additional visible things

  Summary:
RevisionChanges Path
2.13+1  -0  rpm/NEWS
  

  patch -p0 <<'@@ .'
  Index: rpm/NEWS
  
  $ cvs diff -u -r2.12 -r2.13 NEWS
  --- rpm/NEWS  28 Dec 2007 10:50:29 -  2.12
  +++ rpm/NEWS  28 Dec 2007 10:50:45 -  2.13
  @@ -128,6 +128,7 @@
   
 o Additional CLI Features:
   FIXME: rpm -bt for %track execution
  +FIXME: rpm --undefine "macro"
   
 o Application Programming Interface (API) Changes:
   FIXME: << JBJ: please add details! >>
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ poptALL.c rpm/rpmio/ macro.c

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 12:26:50
  Branch: HEAD Handle: 2007122811264901

  Modified files:
rpm CHANGES
rpm/lib poptALL.c
rpm/rpmio   macro.c

  Log:
Fix [EMAIL PROTECTED] macro stack expansion including also the value at the 
stack
bottom and remove the confusing additional --predefine behaviour when
--define is used as the very first CLI option, as this is both a very
bad hack from the year 2002 and especially results in the value of the
first --define option to occur twice on [EMAIL PROTECTED] macro stack 
expansions.

  Summary:
RevisionChanges Path
1.2029  +2  -0  rpm/CHANGES
2.68+9  -0  rpm/lib/poptALL.c
2.166   +1  -1  rpm/rpmio/macro.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2028 -r1.2029 CHANGES
  --- rpm/CHANGES   28 Dec 2007 01:50:11 -  1.2028
  +++ rpm/CHANGES   28 Dec 2007 11:26:49 -  1.2029
  @@ -1,4 +1,6 @@
   5.0b3 -> 5.0b4:
  +- rse: fix [EMAIL PROTECTED] macro stack expansion including also the 
value at the stack bottom
  +- rse: remove the confusing additional --predefine behaviour when 
--define is used as the first CLI option
   - jbj: simplify expandFIFO().
   - jbj: use "\n", not ",", as the default for [EMAIL PROTECTED] expansion.
   - jbj: fixup [EMAIL PROTECTED]:, } per rse comments.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/poptALL.c
  
  $ cvs diff -u -r2.67 -r2.68 poptALL.c
  --- rpm/lib/poptALL.c 27 Dec 2007 17:07:09 -  2.67
  +++ rpm/lib/poptALL.c 28 Dec 2007 11:26:50 -  2.68
  @@ -217,9 +217,18 @@
}
t = s;
if (*t == '%') t++;
  +#if 0
/* XXX Predefine macro if not initialized yet. */
  +/* rse: this is a very bad hack from the year 2002 which especially 
results in
  +   the value of the first --define option to occur twice on [EMAIL 
PROTECTED] macro stack
  +   expansions. We have now disabled it because:
  +   1. it is a very confusing sematic
  +   2. it applies only to the absolutely first occurrence of a 
--define usage
  +   3. there is already the explicit --predefine in case one really 
has to
  +  define a macro before the config files are loaded. */
if (rpmcliInitialized < 0)
(void) rpmDefineMacro(NULL, t, RMIL_CMDLINE);
  +#endif
rpmcliConfigured();
   /[EMAIL PROTECTED]@*/
(void) rpmDefineMacro(NULL, t, RMIL_CMDLINE);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/macro.c
  
  $ cvs diff -u -r2.165 -r2.166 macro.c
  --- rpm/rpmio/macro.c 28 Dec 2007 01:50:11 -  2.165
  +++ rpm/rpmio/macro.c 28 Dec 2007 11:26:50 -  2.166
  @@ -1309,7 +1309,7 @@
   {
   int rc = 0;
   
  -if (me && me->prev && me->prev->prev) {
  +if (me && me->prev) {
rc = expandFIFO(mb, me->prev, g, gn);
rc = expandT(mb, g, gn);
   }
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ devtool.conf

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 13:16:12
  Branch: HEAD Handle: 2007122812161200

  Modified files:
rpm devtool.conf

  Log:
more fat arch tweaks, that were lost with the rpmrc

  Summary:
RevisionChanges Path
2.156   +3  -0  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.155 -r2.156 devtool.conf
  --- rpm/devtool.conf  28 Dec 2007 10:09:36 -  2.155
  +++ rpm/devtool.conf  28 Dec 2007 12:16:12 -  2.156
  @@ -1881,6 +1881,7 @@
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/x86_64
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc64
  +mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/fat
   
   if [ ".$UNIVERSAL_SDK" != "." ]; then
   # setup architectures
  @@ -1904,6 +1905,8 @@
   done
   perl -pi -e 
"s/^\%_arch.*/\%_arch\t\t\tfat/g;s/^\%_build_arch.*/\%_build_arch\t\tfat/g" \
   /tmp/rpm-root/usr/local/lib/rpm/macros
  +perl -pi -e "s/^(\%optflags)(\s+)(.*)/\$1\$2\$3 -arch i386 -arch ppc/g" \
  +/tmp/rpm-root/usr/local/lib/rpm/macros
   fi
   
   # copy required popt.h library header to internal headers
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ devtool.conf

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 13:28:31
  Branch: HEAD Handle: 2007122812283100

  Modified files:
rpm devtool.conf

  Log:
create i386 directory on ppc too

  Summary:
RevisionChanges Path
2.157   +1  -0  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.156 -r2.157 devtool.conf
  --- rpm/devtool.conf  28 Dec 2007 12:16:12 -  2.156
  +++ rpm/devtool.conf  28 Dec 2007 12:28:31 -  2.157
  @@ -1878,6 +1878,7 @@
   rmdir /tmp/rpm-root/usr/local/src/rpm/RPMS/pentium3
   rmdir /tmp/rpm-root/usr/local/src/rpm/RPMS/pentium4
   rmdir /tmp/rpm-root/usr/local/src/rpm/RPMS/i486
  +mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/i386
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/x86_64
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc
   mkdir -p /tmp/rpm-root/usr/local/src/rpm/RPMS/ppc64
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ poptALL.c rpm/ rpmqv.c

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 12:46:59
  Branch: HEAD Handle: 2007122811465801

  Modified files:
rpm CHANGES rpmqv.c
rpm/lib poptALL.c

  Log:
make rpm --version nice and quiet again (also fixes missing
translation)

  Summary:
RevisionChanges Path
1.2030  +1  -0  rpm/CHANGES
2.69+4  -2  rpm/lib/poptALL.c
1.136   +4  -2  rpm/rpmqv.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2029 -r1.2030 CHANGES
  --- rpm/CHANGES   28 Dec 2007 11:26:49 -  1.2029
  +++ rpm/CHANGES   28 Dec 2007 11:46:58 -  1.2030
  @@ -1,4 +1,5 @@
   5.0b3 -> 5.0b4:
  +- afb: hide the rpmlib Version/Timestamp/Vendor markers spew unless 
verbose.
   - rse: fix [EMAIL PROTECTED] macro stack expansion including also the 
value at the stack bottom
   - rse: remove the confusing additional --predefine behaviour when 
--define is used as the first CLI option
   - jbj: simplify expandFIFO().
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/poptALL.c
  
  $ cvs diff -u -r2.68 -r2.69 poptALL.c
  --- rpm/lib/poptALL.c 28 Dec 2007 11:26:50 -  2.68
  +++ rpm/lib/poptALL.c 28 Dec 2007 11:46:59 -  2.69
  @@ -157,8 +157,10 @@
/[EMAIL PROTECTED] rpmEVR, fileSystem @*/
/[EMAIL PROTECTED] *fp, fileSystem @*/
   {
  -fprintf(fp, _("%s version %s rpmlib markers (0x%08x,0x%08x,0x%08X)\n"),
  - RPM_NAME, rpmEVR, rpmlibVersion(), rpmlibTimestamp(), rpmlibVendor());
  +fprintf(fp, _(RPM_NAME" version %s\n"), rpmEVR);
  +if (rpmIsVerbose())
  + fprintf(fp, "rpmlib markers (0x%08x,0x%08x,0x%08X)\n",
  + rpmlibVersion(), rpmlibTimestamp(), rpmlibVendor());
   }
   
   void rpmcliConfigured(void)
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmqv.c
  
  $ cvs diff -u -r1.135 -r1.136 rpmqv.c
  --- rpm/rpmqv.c   23 Dec 2007 20:20:14 -  1.135
  +++ rpm/rpmqv.c   28 Dec 2007 11:46:58 -  1.136
  @@ -149,8 +149,10 @@
/[EMAIL PROTECTED] rpmEVR, fileSystem @*/
/[EMAIL PROTECTED] *fp, fileSystem @*/
   {
  -fprintf(fp, _("%s version %s rpmlib markers (0x%08x,0x%08x,0x%08X)\n"),
  - RPM_NAME, rpmEVR, rpmlibVersion(), rpmlibTimestamp(), rpmlibVendor());
  +fprintf(fp, _(RPM_NAME" version %s\n"), rpmEVR);
  +if (rpmIsVerbose())
  + fprintf(fp, "rpmlib markers (0x%08x,0x%08x,0x%08X)\n",
  + rpmlibVersion(), rpmlibTimestamp(), rpmlibVendor());
   }
   
   static void printUsage(poptContext con, FILE * fp, int flags)
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ depends.c

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 14:20:22
  Branch: HEAD Handle: 2007122813202200

  Modified files:
rpm CHANGES
rpm/lib depends.c

  Log:
Fix invocaction of GnuPG's gpg(1) command for gnupg() dependency
assertions: the options "-qv" would be "--quiet --verbose" and actually
would lead to an encryption operation.

  Summary:
RevisionChanges Path
1.2031  +1  -0  rpm/CHANGES
1.374   +1  -1  rpm/lib/depends.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2030 -r1.2031 CHANGES
  --- rpm/CHANGES   28 Dec 2007 11:46:58 -  1.2030
  +++ rpm/CHANGES   28 Dec 2007 13:20:22 -  1.2031
  @@ -1,4 +1,5 @@
   5.0b3 -> 5.0b4:
  +- rse: fix invocaction of GnuPG's gpg(1) command for gnupg() 
dependency assertions
   - afb: hide the rpmlib Version/Timestamp/Vendor markers spew unless 
verbose.
   - rse: fix [EMAIL PROTECTED] macro stack expansion including also the 
value at the stack bottom
   - rse: remove the confusing additional --predefine behaviour when 
--define is used as the first CLI option
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/depends.c
  
  $ cvs diff -u -r1.373 -r1.374 depends.c
  --- rpm/lib/depends.c 26 Dec 2007 10:40:45 -  1.373
  +++ rpm/lib/depends.c 28 Dec 2007 13:20:22 -  1.374
  @@ -822,7 +822,7 @@
   }
   
   if (NSType == RPMNS_TYPE_GNUPG) {
  - static const char gnupg_pre[] = "%(%{__gpg} -qv ";
  + static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty --quiet 
--verify ";
static const char gnupg_post[] = " 2>/dev/null; echo $?)";
const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL);
   
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ depends.c

2007-12-28 Thread Ralf S. Engelschall
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Ralf S. Engelschall
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 15:00:30
  Branch: HEAD Handle: 2007122814002901

  Modified files:
rpm CHANGES
rpm/lib depends.c

  Log:
Allow assertion of a particular GnuPG signing key via "gnupg()
= " in dependencies -- instead of just checking whether
 was signed by _ANY_ key present in the GnuPG key ring.

  Summary:
RevisionChanges Path
1.2032  +1  -0  rpm/CHANGES
1.375   +15 -6  rpm/lib/depends.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2031 -r1.2032 CHANGES
  --- rpm/CHANGES   28 Dec 2007 13:20:22 -  1.2031
  +++ rpm/CHANGES   28 Dec 2007 14:00:29 -  1.2032
  @@ -1,4 +1,5 @@
   5.0b3 -> 5.0b4:
  +- rse: allow assertion of a particular GnuPG signing key via 
"gnupg() = " in dependencies
   - rse: fix invocaction of GnuPG's gpg(1) command for gnupg() 
dependency assertions
   - afb: hide the rpmlib Version/Timestamp/Vendor markers spew unless 
verbose.
   - rse: fix [EMAIL PROTECTED] macro stack expansion including also the 
value at the stack bottom
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/depends.c
  
  $ cvs diff -u -r1.374 -r1.375 depends.c
  --- rpm/lib/depends.c 28 Dec 2007 13:20:22 -  1.374
  +++ rpm/lib/depends.c 28 Dec 2007 14:00:30 -  1.375
  @@ -822,12 +822,21 @@
   }
   
   if (NSType == RPMNS_TYPE_GNUPG) {
  - static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty --quiet 
--verify ";
  - static const char gnupg_post[] = " 2>/dev/null; echo $?)";
  - const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL);
  -
  - rc = (t && t[0] == '0') ? 0 : 1;
  - t = _free(t);
  + const char * EVR = rpmdsEVR(dep);
  + if (!(EVR && *EVR)) {
  + static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty 
--quiet --verify ";
  + static const char gnupg_post[] = " 2>/dev/null; echo $?)";
  + const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL);
  + rc = (t && t[0] == '0') ? 0 : 1;
  + t = _free(t);
  +}
  +else {
  + static const char gnupg_pre[] = "%(%{__gpg} --batch --no-tty 
--quiet --verify ";
  + static const char gnupg_post[] = " 2>&1 | grep '^Primary key 
fingerprint:' | sed -e 's;^.*: *;;' -e 's; *;;g')";
  + const char * t = rpmExpand(gnupg_pre, Name, gnupg_post, NULL);
  + rc = ((Flags & RPMSENSE_EQUAL) && strcasecmp(EVR, t) == 0) ? 0 : 1;
  + t = _free(t);
  +}
if (Flags & RPMSENSE_MISSINGOK)
goto unsatisfied;
rpmdsNotify(dep, _("(gnupg probe)"), rc);
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ devtool.conf

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 18:15:10
  Branch: HEAD Handle: 2007122817150900

  Modified files:
rpm devtool.conf

  Log:
no debugging symbols on darwin, since strip scripts are disabled

  Summary:
RevisionChanges Path
2.158   +1  -1  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.157 -r2.158 devtool.conf
  --- rpm/devtool.conf  28 Dec 2007 12:28:31 -  2.157
  +++ rpm/devtool.conf  28 Dec 2007 17:15:09 -  2.158
  @@ -1900,7 +1900,7 @@
   \%_osdarwin
   \%_gnu   %{nil}
   \%_target_platform   %{_target_cpu}-%{_vendor}-%{_target_os}
  -\%optflags   -O2 -g
  +\%optflags   -O2
   
   __EOF__
   done
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ .cvsignore Makefile.am genpgp.sh tpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 19:15:40
  Branch: HEAD Handle: 2007122818154000

  Added files:
rpm/lib genpgp.sh tpgp.c
  Modified files:
rpm/lib .cvsignore Makefile.am

  Log:
- jbj: setup a pgp(...) workbench.

  Summary:
RevisionChanges Path
1.10+2  -0  rpm/lib/.cvsignore
2.170   +9  -2  rpm/lib/Makefile.am
2.1 +45 -0  rpm/lib/genpgp.sh
2.1 +173 -0 rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/.cvsignore
  
  $ cvs diff -u -r1.9 -r1.10 .cvsignore
  --- rpm/lib/.cvsignore2 Dec 2007 15:33:53 -   1.9
  +++ rpm/lib/.cvsignore28 Dec 2007 18:15:40 -  1.10
  @@ -2,8 +2,10 @@
   .depend
   Makefile
   Makefile.in
  +genpgp.h
   getdate.c
   rpmversion.h
  +tpgp
   .libs
   *.la
   *.lcd
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/Makefile.am
  
  $ cvs diff -u -r2.169 -r2.170 Makefile.am
  --- rpm/lib/Makefile.am   18 Dec 2007 19:40:53 -  2.169
  +++ rpm/lib/Makefile.am   28 Dec 2007 18:15:40 -  2.170
  @@ -18,9 +18,9 @@
@WITH_FILE_CPPFLAGS@ \
@WITH_XAR_CPPFLAGS@
   
  -EXTRA_DIST = getdate.y librpm.vers
  +EXTRA_DIST = genpgp.sh getdate.y librpm.vers tpgp.c
   
  -EXTRA_PROGRAMS =
  +EXTRA_PROGRAMS = tpgp
   
   pkgincdir = $(pkgincludedir)$(WITH_PATH_VERSIONED_SUFFIX)
   pkginc_HEADERS = \
  @@ -117,3 +117,10 @@
   .PHONY:  lint
   lint:
$(LINT) $(DEFS) $(INCLUDES) $(librpm_la_SOURCES)
  +
  +tpgp_SOURCES = genpgp.h tpgp.c
  +tpgp_CFLAGS  = $(CFLAGS)
  +tpgp_LDADD = librpm.la
  +
  +genpgp.h:
  + -sh ./genpgp.sh > genpgp.h
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/genpgp.sh
  
  $ cvs diff -u -r0 -r2.1 genpgp.sh
  --- /dev/null 2007-12-28 19:11:47 +0100
  +++ genpgp.sh 2007-12-28 19:15:40 +0100
  @@ -0,0 +1,45 @@
  +#!/bin/sh
  +
  +hdir="`pwd`/.gnupg"
  +gpg="gpg --homedir $hdir"
  +
  +rm -rf $hdir
  +
  +$gpg --gen-key --batch << GO_SYSIN_DD
  +Key-Type: DSA
  +Key-Length: 1024
  +Key-Usage: sign
  +Name-Real: DSApub
  +Name-Comment: 1024
  +Name-Email: [EMAIL PROTECTED]
  +%commit
  +Key-Type: RSA
  +Key-Length: 1024
  +Key-Usage: sign
  +Name-Real: RSApub
  +Name-Comment: 1024
  +Name-Email: [EMAIL PROTECTED]
  +%commit
  +GO_SYSIN_DD
  +
  +str="abc"
  +echo "static const char * str = \"$str\";"
  +
  +echo "static const char * DSApub ="
  +$gpg --export -a -u DSApub | sed -e'1,3d; $d' | sed -e's/^/"/; s/$/\\n"/; $d'
  +echo ";"
  +
  +echo "static const char * DSAsig ="
  +echo -n "$str" | $gpg -sab -u DSApub | sed -e'1,3d; $d' | sed -e's/^/"/; 
s/$/\\n"/; $d'
  +echo ";"
  +
  +echo "static const char * RSApub ="
  +$gpg --export -a -u RSApub | sed -e'1,3d; $d' | sed -e's/^/"/; s/$/\\n"/; $d'
  +echo ";"
  +
  +echo "static const char * RSAsig ="
  +echo -n "$str" | $gpg -sab -u RSApub | sed -e'1,3d; $d' | sed -e's/^/"/; 
s/$/\\n"/; $d'
  +echo ";"
  +
  +rm -rf $hdir
  +
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r0 -r2.1 tpgp.c
  --- /dev/null 2007-12-28 19:11:47 +0100
  +++ tpgp.c2007-12-28 19:15:40 +0100
  @@ -0,0 +1,173 @@
  +/** \ingroup rpmio signature
  + * \file rpmio/tkey.c
  + * Routines to handle RFC-2440 detached signatures.
  + */
  +
  +static int _debug = 0;
  +extern int _pgp_debug;
  +extern int _pgp_print;
  +
  +#include "system.h"
  +#include 
  +
  +#define  _RPMPGP_INTERNAL
  +#define  _RPMBC_INTERNAL
  +#include 
  +#define  _RPMGC_INTERNAL
  +#include 
  +#define  _RPMNSS_INTERNAL
  +#include 
  +#define  _RPMSSL_INTERNAL
  +#include 
  +
  +#include "genpgp.h"
  +
  +#include "debug.h"
  +
  +static int doit(const char *sig, pgpDig dig, int printing)
  +{
  +const char *s, *t;
  +unsigned char * dec;
  +size_t declen;
  +char * enc;
  +int rc;
  +int i;
  +
  +if (_debug)
  +fprintf(stderr, "*** before\n%s\n", sig);
  +
  +if ((rc = b64decode(sig, (void **)&dec, &declen)) != 0) {
  + fprintf(stderr, "*** b64decode returns %d\n", rc);
  + return rc;
  +}
  +rc = pgpPrtPkts(dec, declen, dig, printing);
  +if (rc < 0) {
  + fprintf(stderr, "*** pgpPrtPkts returns %d\n", rc);
  + return rc;
  +}
  +
  +if ((enc = b64encode(dec, declen)) == NULL) {
 

[CVS] RPM: rpm/ devtool.conf

2007-12-28 Thread Anders F. Bj�rklund
  RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  

  Server: rpm5.org Name:   Anders F. Björklund
  Root:   /v/rpm/cvs   Email:  [EMAIL PROTECTED]
  Module: rpm  Date:   28-Dec-2007 19:47:26
  Branch: HEAD Handle: 2007122818472600

  Modified files:
rpm devtool.conf

  Log:
set doxygen to auto on %macosx, so that build doesn't break if it's
missing

  Summary:
RevisionChanges Path
2.159   +1  -1  rpm/devtool.conf
  

  patch -p0 <<'@@ .'
  Index: rpm/devtool.conf
  
  $ cvs diff -u -r2.158 -r2.159 devtool.conf
  --- rpm/devtool.conf  28 Dec 2007 17:15:09 -  2.158
  +++ rpm/devtool.conf  28 Dec 2007 18:47:26 -  2.159
  @@ -1791,7 +1791,7 @@
   --with-popt="$basemac/bin/popt-${v_popt}" \
   --with-perl \
   --with-python \
  ---with-apidocs \
  +--with-apidocs=auto \
   --disable-static \
   --enable-shared \
   --disable-rpath \
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ genpgp.sh tpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 20:05:21
  Branch: HEAD Handle: 2007122819052100

  Modified files:
rpm/lib genpgp.sh tpgp.c

  Log:
- jbj: stub in a test harness.

  Summary:
RevisionChanges Path
2.2 +17 -20 rpm/lib/genpgp.sh
2.2 +25 -121rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/genpgp.sh
  
  $ cvs diff -u -r2.1 -r2.2 genpgp.sh
  --- rpm/lib/genpgp.sh 28 Dec 2007 18:15:40 -  2.1
  +++ rpm/lib/genpgp.sh 28 Dec 2007 19:05:21 -  2.2
  @@ -22,24 +22,21 @@
   %commit
   GO_SYSIN_DD
   
  -str="abc"
  -echo "static const char * str = \"$str\";"
  -
  -echo "static const char * DSApub ="
  -$gpg --export -a -u DSApub | sed -e'1,3d; $d' | sed -e's/^/"/; s/$/\\n"/; $d'
  -echo ";"
  -
  -echo "static const char * DSAsig ="
  -echo -n "$str" | $gpg -sab -u DSApub | sed -e'1,3d; $d' | sed -e's/^/"/; 
s/$/\\n"/; $d'
  -echo ";"
  -
  -echo "static const char * RSApub ="
  -$gpg --export -a -u RSApub | sed -e'1,3d; $d' | sed -e's/^/"/; s/$/\\n"/; $d'
  -echo ";"
  -
  -echo "static const char * RSAsig ="
  -echo -n "$str" | $gpg -sab -u RSApub | sed -e'1,3d; $d' | sed -e's/^/"/; 
s/$/\\n"/; $d'
  -echo ";"
  -
  -rm -rf $hdir
  +str="This is the plaintext"
  +echo "This is the plaintext" > plaintext
   
  +$gpg --detach-sign -a -u DSApub --output - plaintext > DSA.sig
  +$gpg --clearsign -u DSApub --output - plaintext > DSA.pem
  +$gpg --export -a -u DSApub > DSA.pub
  +
  +echo "static const char * DSAsig = \"DSA.sig\";"
  +echo "static const char * DSApem = \"DSA.pem\";"
  +echo "static const char * DSApub = \"DSA.pub\";"
  +
  +$gpg --detach-sign -a -u RSApub --output - plaintext > RSA.sig
  +$gpg --clearsign -u RSApub --output - plaintext > RSA.pem
  +$gpg --export -a -u RSApub > RSA.pubkey
  +
  +echo "static const char * RSAsig = \"RSA.sig\";"
  +echo "static const char * RSApem = \"RSA.pem\";"
  +echo "static const char * RSApub = \"RSA.pub\";"
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.1 -r2.2 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 18:15:40 -  2.1
  +++ rpm/lib/tpgp.c28 Dec 2007 19:05:21 -  2.2
  @@ -3,7 +3,7 @@
* Routines to handle RFC-2440 detached signatures.
*/
   
  -static int _debug = 0;
  +static int _debug = 1;
   extern int _pgp_debug;
   extern int _pgp_print;
   
  @@ -24,147 +24,51 @@
   
   #include "debug.h"
   
  -static int doit(const char *sig, pgpDig dig, int printing)
  +static
  +int rpmCheckPgpSignatureOnFile(const char * fn, const char * sigfn,
  + const char * pubfn, const char * pubfingerprint)
   {
  -const char *s, *t;
  -unsigned char * dec;
  -size_t declen;
  -char * enc;
  -int rc;
  -int i;
  -
  -if (_debug)
  -fprintf(stderr, "*** before\n%s\n", sig);
  -
  -if ((rc = b64decode(sig, (void **)&dec, &declen)) != 0) {
  - fprintf(stderr, "*** b64decode returns %d\n", rc);
  - return rc;
  -}
  -rc = pgpPrtPkts(dec, declen, dig, printing);
  -if (rc < 0) {
  - fprintf(stderr, "*** pgpPrtPkts returns %d\n", rc);
  - return rc;
  -}
  -
  -if ((enc = b64encode(dec, declen)) == NULL) {
  - fprintf(stderr, "*** b64encode failed\n");
  - return rc;
  -}
  -dec = _free(dec);
   
   if (_debug)
  -fprintf(stderr, "***  after\n%s\n", enc);
  -
  -rc = 0;
  -for (i = 0, s = sig, t = enc; *s & *t; i++, s++, t++) {
  -if (*s == '\n') s++;
  -if (*t == '\n') t++;
  -if (*s == *t) continue;
  -fprintf(stderr, "??? %5d %02x != %02x '%c' != '%c'\n", i, (*s & 0xff), (*t & 
0xff), *s, *t);
  -rc = 5;
  +fprintf(stderr, "==> check(%s, %s, %s, %s)\n", fn, sigfn, pubfn, 
pubfingerprint);
  +return 1;
   }
  -enc = _free(enc);
  -
  -return rc;
  -}
  -
  -/* FIPS-186 test vectors. */
  -static const char * fips_p = 
"8df2a494492276aa3d25759bb06869cbeac0d83afb8d0cf7cbb8324f0d7882e5d0762fc5b7210eafc2e9adac32ab7aac49693dfbf83724c2ec0736ee31c80291";
  -static const char * fips_q = "c773218c737ec8ee993b4f2ded30f48edace915f";
  -static const char * fips_g = 
"626d027839ea0a13413163a55b4cb500299d5522956cefcb3bff10f399ce2c2e71cb9de5fa24babf58e5b79521925c9cc42e9f6f464b088cc572af53e6d78802";
  -
  -static const char * fips_hm = "a9993e364706816aba3e25717850c26c9cd0d89d";
  -
  -static const char * fips_y = 
"19131871d75b1612a819f29d78d1b0d7346f7aa77bb62a859bfd6c5675da9d212d3a36ef16

[CVS] RPM: rpm/lib/ genpgp.sh tpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 20:54:51
  Branch: HEAD Handle: 2007122819545100

  Modified files:
rpm/lib genpgp.sh tpgp.c

  Log:
- jbj: parse pubkeys.

  Summary:
RevisionChanges Path
2.3 +1  -1  rpm/lib/genpgp.sh
2.3 +38 -2  rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/genpgp.sh
  
  $ cvs diff -u -r2.2 -r2.3 genpgp.sh
  --- rpm/lib/genpgp.sh 28 Dec 2007 19:05:21 -  2.2
  +++ rpm/lib/genpgp.sh 28 Dec 2007 19:54:51 -  2.3
  @@ -35,7 +35,7 @@
   
   $gpg --detach-sign -a -u RSApub --output - plaintext > RSA.sig
   $gpg --clearsign -u RSApub --output - plaintext > RSA.pem
  -$gpg --export -a -u RSApub > RSA.pubkey
  +$gpg --export -a -u RSApub > RSA.pub
   
   echo "static const char * RSAsig = \"RSA.sig\";"
   echo "static const char * RSApem = \"RSA.pem\";"
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.2 -r2.3 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 19:05:21 -  2.2
  +++ rpm/lib/tpgp.c28 Dec 2007 19:54:51 -  2.3
  @@ -9,6 +9,7 @@
   
   #include "system.h"
   #include 
  +#include 
   
   #define  _RPMPGP_INTERNAL
   #define  _RPMBC_INTERNAL
  @@ -28,17 +29,52 @@
   int rpmCheckPgpSignatureOnFile(const char * fn, const char * sigfn,
const char * pubfn, const char * pubfingerprint)
   {
  +const char * _fn = NULL;
  +const char * _sigfn = NULL;
  +const unsigned char * sigpkt = NULL;
  +size_t sigpktlen = 0;
  +const char * _pubfn = NULL;
  +const unsigned char * pubpkt = NULL;
  +size_t pubpktlen = 0;
  +int rc = 0;
  +int xx;
   
   if (_debug)
   fprintf(stderr, "==> check(%s, %s, %s, %s)\n", fn, sigfn, pubfn, 
pubfingerprint);
  -return 1;
  +
  +_fn = rpmExpand(fn, NULL);
  +
  +#ifdef   NOTYET
  +_sigfn = rpmExpand(sigfn, NULL);
  +xx = pgpReadPkts(_sigfn, &sigpkt, &sigpktlen);
  +if (xx != PGPARMOR_SIGNATURE) {
  +fprintf(stderr, "==> pgpReadPkts(%s) SIG %p[%u] ret %d\n", _sigfn, sigpkt, 
sigpktlen, xx);
  + goto exit;
  +}
  +#endif
  +
  +_pubfn = rpmExpand(pubfn, NULL);
  +xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  +if (xx != PGPARMOR_PUBKEY) {
  +fprintf(stderr, "==> pgpReadPkts(%s) PUB %p[%u] ret %d\n", _pubfn, pubpkt, 
pubpktlen, xx);
  + goto exit;
  +}
  +
  +rc = 1;
  +
  +exit:
  +pubpkt = _free(pubpkt);
  +_pubfn = _free(_pubfn);
  +sigpkt = _free(sigpkt);
  +_sigfn = _free(_sigfn);
  +_fn = _free(_fn);
  +return rc;
   }
   
   static
   int doit(const char * sigtype)
   {
   pgpDig dig;
  -int printing = -1;
   int rc = 0;
   
   dig = pgpDigNew(0);
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/ CHANGES rpm/lib/ tpgp.c rpm/rpmio/ rpmpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 21:55:14
  Branch: HEAD Handle: 2007122820551400

  Modified files:
rpm CHANGES
rpm/lib tpgp.c
rpm/rpmio   rpmpgp.c

  Log:
- fix: undo deliberate damage from rpm's RHL8 security audit. ptooey!

  Summary:
RevisionChanges Path
1.2033  +1  -0  rpm/CHANGES
2.4 +0  -2  rpm/lib/tpgp.c
2.83+4  -6  rpm/rpmio/rpmpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2032 -r1.2033 CHANGES
  --- rpm/CHANGES   28 Dec 2007 14:00:29 -  1.2032
  +++ rpm/CHANGES   28 Dec 2007 20:55:14 -  1.2033
  @@ -1,4 +1,5 @@
   5.0b3 -> 5.0b4:
  +- jbj: fix: undo deliberate damage from rpm's RHL8 security audit. 
ptooey!
   - rse: allow assertion of a particular GnuPG signing key via 
"gnupg() = " in dependencies
   - rse: fix invocaction of GnuPG's gpg(1) command for gnupg() 
dependency assertions
   - afb: hide the rpmlib Version/Timestamp/Vendor markers spew unless 
verbose.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.3 -r2.4 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 19:54:51 -  2.3
  +++ rpm/lib/tpgp.c28 Dec 2007 20:55:14 -  2.4
  @@ -44,14 +44,12 @@
   
   _fn = rpmExpand(fn, NULL);
   
  -#ifdef   NOTYET
   _sigfn = rpmExpand(sigfn, NULL);
   xx = pgpReadPkts(_sigfn, &sigpkt, &sigpktlen);
   if (xx != PGPARMOR_SIGNATURE) {
   fprintf(stderr, "==> pgpReadPkts(%s) SIG %p[%u] ret %d\n", _sigfn, sigpkt, 
sigpktlen, xx);
goto exit;
   }
  -#endif
   
   _pubfn = rpmExpand(pubfn, NULL);
   xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/rpmio/rpmpgp.c
  
  $ cvs diff -u -r2.82 -r2.83 rpmpgp.c
  --- rpm/rpmio/rpmpgp.c26 Dec 2007 10:40:45 -  2.82
  +++ rpm/rpmio/rpmpgp.c28 Dec 2007 20:55:14 -  2.83
  @@ -1284,15 +1284,15 @@
goto exit;
   }
   
  +/* Read unarmored packets. */
   if (pgpIsPkt(b)) {
  -#ifdef NOTYET/* XXX ASCII Pubkeys only, please. */
  - ec = 0; /* XXX fish out pkt type. */
  -#endif
  + ec = 0; /* XXX FIXME: fish out pkt type from unarmored item. */
goto exit;
   }
   
   #define  TOKEQ(_s, _tok) (!strncmp((_s), (_tok), sizeof(_tok)-1))
   
  +/* Read armored packets, converting to binary. */
   for (t = (char *)b; t && *t; t = te) {
if ((te = strchr(t, '\n')) == NULL)
te = t + strlen(t);
  @@ -1311,8 +1311,7 @@
ec = PGPARMOR_ERR_UNKNOWN_ARMOR_TYPE;
goto exit;
}
  - if (rc != PGPARMOR_PUBKEY)  /* XXX ASCII Pubkeys only, please. */
  - continue;
  + ec = rc;/* Save the packet type as exit code. */
armortype = t;
   
t = strchr(t, '\n');
  @@ -1396,7 +1395,6 @@
b = _free(b);
b = dec;
blen = declen;
  - ec = PGPARMOR_PUBKEY;   /* XXX ASCII Pubkeys only, please. */
goto exit;
/[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ break;
}
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ tpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 23:02:51
  Branch: HEAD Handle: 2007122822025100

  Modified files:
rpm/lib tpgp.c

  Log:
- jbj: functional DSA/RSA verify (albeit w hotwired plaintext).

  Summary:
RevisionChanges Path
2.5 +69 -12 rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.4 -r2.5 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 20:55:14 -  2.4
  +++ rpm/lib/tpgp.c28 Dec 2007 22:02:51 -  2.5
  @@ -29,6 +29,9 @@
   int rpmCheckPgpSignatureOnFile(const char * fn, const char * sigfn,
const char * pubfn, const char * pubfingerprint)
   {
  +static const char * plaintext = "This is the plaintext\n";
  +pgpDig dig;
  +pgpDigParams sigp;
   const char * _fn = NULL;
   const char * _sigfn = NULL;
   const unsigned char * sigpkt = NULL;
  @@ -36,12 +39,16 @@
   const char * _pubfn = NULL;
   const unsigned char * pubpkt = NULL;
   size_t pubpktlen = 0;
  +DIGEST_CTX ctx = NULL;
  +int printing = 0;
   int rc = 0;
   int xx;
   
   if (_debug)
   fprintf(stderr, "==> check(%s, %s, %s, %s)\n", fn, sigfn, pubfn, 
pubfingerprint);
   
  +dig = pgpDigNew(0);
  +
   _fn = rpmExpand(fn, NULL);
   
   _sigfn = rpmExpand(sigfn, NULL);
  @@ -50,6 +57,7 @@
   fprintf(stderr, "==> pgpReadPkts(%s) SIG %p[%u] ret %d\n", _sigfn, sigpkt, 
sigpktlen, xx);
goto exit;
   }
  +xx = pgpPrtPkts((uint8_t *)sigpkt, sigpktlen, dig, printing);
   
   _pubfn = rpmExpand(pubfn, NULL);
   xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  @@ -57,8 +65,58 @@
   fprintf(stderr, "==> pgpReadPkts(%s) PUB %p[%u] ret %d\n", _pubfn, pubpkt, 
pubpktlen, xx);
goto exit;
   }
  +xx = pgpPrtPkts((uint8_t *)pubpkt, pubpktlen, dig, printing);
  +
  +sigp = pgpGetSignature(dig);
  +
  +if (sigp->version != 3 && sigp->version != 4) {
  +fprintf(stderr, "==> unverifiable V%d\n", sigp->version);
  + goto exit;
  +}
  +
  +ctx = rpmDigestInit(sigp->hash_algo, RPMDIGEST_NONE);
  +
  +xx = rpmDigestUpdate(ctx, plaintext, strlen(plaintext));
  +
  +if (sigp->hash != NULL)
  + xx = rpmDigestUpdate(ctx, sigp->hash, sigp->hashlen);
  +if (sigp->version == 4) {
  + uint32_t nb = sigp->hashlen;
  + uint8_t trailer[6];
  + nb = htonl(nb);
  + trailer[0] = sigp->version;
  + trailer[1] = 0xff;
  + memcpy(trailer+2, &nb, sizeof(nb));
  + xx = rpmDigestUpdate(ctx, trailer, sizeof(trailer));
  +}
  +
  +switch(sigp->pubkey_algo) {
  +default:
  + xx = 1;
  + break;
  +case PGPPUBKEYALGO_DSA:
  + xx = pgpImplSetDSA(ctx, dig, sigp);
  + break;
  +case PGPPUBKEYALGO_RSA:
  + xx = pgpImplSetRSA(ctx, dig, sigp);
  + break;
  +}
  +if (xx) {
  +fprintf(stderr, "==> can't load pubkey_algo(%u)\n", sigp->pubkey_algo);
  + goto exit;
  +}
   
  -rc = 1;
  +switch(sigp->pubkey_algo) {
  +default:
  + rc = 0;
  + break;
  +case PGPPUBKEYALGO_DSA:
  + rc = pgpImplVerifyDSA(dig);
  + break;
  +case PGPPUBKEYALGO_RSA:
  + rc = pgpImplVerifyRSA(dig);
  + break;
  +}
   
   exit:
   pubpkt = _free(pubpkt);
  @@ -66,29 +124,28 @@
   sigpkt = _free(sigpkt);
   _sigfn = _free(_sigfn);
   _fn = _free(_fn);
  +
  +dig = pgpDigFree(dig);
  +
  +if (_debug)
  +fprintf(stderr, " verify: rc %d\n", rc);
  +
   return rc;
   }
   
   static
   int doit(const char * sigtype)
   {
  -pgpDig dig;
   int rc = 0;
   
  -dig = pgpDigNew(0);
  -
  -if (!strcmp("DSA", sigtype))
  +if (!strcmp("DSA", sigtype)) {
rc = rpmCheckPgpSignatureOnFile("plaintext", DSAsig, DSApub, NULL);
  -if (!strcmp("RSA", sigtype))
  +}
  +if (!strcmp("RSA", sigtype)) {
rc = rpmCheckPgpSignatureOnFile("plaintext", RSAsig, RSApub, NULL);
  +}
   
  -if (_debug)
  -fprintf(stderr, " %s verify: rc %d\n", sigtype, 
rc);
  -
  -dig = pgpDigFree(dig);
  -
   return rc;
  -
   }
   
   int
  @@ .
__
RPM Package Managerhttp://rpm5.org
CVS Sources Repositoryrpm-cvs@rpm5.org


[CVS] RPM: rpm/lib/ tpgp.c

2007-12-28 Thread Jeff Johnson
  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-Dec-2007 23:43:48
  Branch: HEAD Handle: 2007122822434800

  Modified files:
rpm/lib tpgp.c

  Log:
- jbj: slurp the plaintext instead of hotwiring. Simplify the mess.

  Summary:
RevisionChanges Path
2.6 +47 -22 rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.5 -r2.6 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 22:02:51 -  2.5
  +++ rpm/lib/tpgp.c28 Dec 2007 22:43:48 -  2.6
  @@ -29,14 +29,10 @@
   int rpmCheckPgpSignatureOnFile(const char * fn, const char * sigfn,
const char * pubfn, const char * pubfingerprint)
   {
  -static const char * plaintext = "This is the plaintext\n";
  -pgpDig dig;
  +pgpDig dig = pgpDigNew(0);
   pgpDigParams sigp;
  -const char * _fn = NULL;
  -const char * _sigfn = NULL;
   const unsigned char * sigpkt = NULL;
   size_t sigpktlen = 0;
  -const char * _pubfn = NULL;
   const unsigned char * pubpkt = NULL;
   size_t pubpktlen = 0;
   DIGEST_CTX ctx = NULL;
  @@ -47,25 +43,41 @@
   if (_debug)
   fprintf(stderr, "==> check(%s, %s, %s, %s)\n", fn, sigfn, pubfn, 
pubfingerprint);
   
  -dig = pgpDigNew(0);
  -
  -_fn = rpmExpand(fn, NULL);
  -
  -_sigfn = rpmExpand(sigfn, NULL);
  -xx = pgpReadPkts(_sigfn, &sigpkt, &sigpktlen);
  -if (xx != PGPARMOR_SIGNATURE) {
  +/* Load the signature. Use sigfn if specified, otherwise clearsign. */
  +if (sigfn != NULL) {
  + const char * _sigfn = rpmExpand(sigfn, NULL);
  + xx = pgpReadPkts(_sigfn, &sigpkt, &sigpktlen);
  + if (xx != PGPARMOR_SIGNATURE) {
   fprintf(stderr, "==> pgpReadPkts(%s) SIG %p[%u] ret %d\n", _sigfn, sigpkt, 
sigpktlen, xx);
  - goto exit;
  + _sigfn = _free(_sigfn);
  + goto exit;
  + }
  + _sigfn = _free(_sigfn);
  +} else {
   }
   xx = pgpPrtPkts((uint8_t *)sigpkt, sigpktlen, dig, printing);
  +if (xx) {
  +fprintf(stderr, "==> pgpPrtPkts SIG %p[%u] ret %d\n", sigpkt, sigpktlen, xx);
  + goto exit;
  +}
   
  -_pubfn = rpmExpand(pubfn, NULL);
  -xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  -if (xx != PGPARMOR_PUBKEY) {
  +/* Load the pubkey. Use pubfn if specified, otherwise rpmdb keyring. */
  +if (pubfn != NULL) {
  + const char * _pubfn = rpmExpand(pubfn, NULL);
  + xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  + if (xx != PGPARMOR_PUBKEY) {
   fprintf(stderr, "==> pgpReadPkts(%s) PUB %p[%u] ret %d\n", _pubfn, pubpkt, 
pubpktlen, xx);
  - goto exit;
  + _pubfn = _free(_pubfn);
  + goto exit;
  + }
  + _pubfn = _free(_pubfn);
  +} else {
   }
   xx = pgpPrtPkts((uint8_t *)pubpkt, pubpktlen, dig, printing);
  +if (xx) {
  +fprintf(stderr, "==> pgpPrtPkts PUB %p[%u] ret %d\n", pubpkt, pubpktlen, xx);
  + goto exit;
  +}
   
   sigp = pgpGetSignature(dig);
   
  @@ -74,9 +86,24 @@
goto exit;
   }
   
  +/* Compute the message digest. */
   ctx = rpmDigestInit(sigp->hash_algo, RPMDIGEST_NONE);
   
  -xx = rpmDigestUpdate(ctx, plaintext, strlen(plaintext));
  +{const char * _fn = rpmExpand(fn, NULL);
  + const char * b = NULL;
  + size_t blen = 0;
  + int _rc = rpmioSlurp(_fn, &b, &blen);
  +
  + if (!(_rc == 0 && b != NULL && blen > 0)) {
  +fprintf(stderr, "==> rpmioSlurp(%s) MSG %p[%u] ret %d\n", _fn, b, blen, _rc);
  + b = _free(b);
  + _fn = _free(_fn);
  + goto exit;
  + }
  + _fn = _free(_fn);
  + xx = rpmDigestUpdate(ctx, b, blen);
  + b = _free(b);
  +}
   
   if (sigp->hash != NULL)
xx = rpmDigestUpdate(ctx, sigp->hash, sigp->hashlen);
  @@ -90,6 +117,7 @@
xx = rpmDigestUpdate(ctx, trailer, sizeof(trailer));
   }
   
  +/* Load the message digest. */
   switch(sigp->pubkey_algo) {
   default:
xx = 1;
  @@ -106,6 +134,7 @@
goto exit;
   }
   
  +/* Verify the signature. */
   switch(sigp->pubkey_algo) {
   default:
rc = 0;
  @@ -120,11 +149,7 @@
   
   exit:
   pubpkt = _free(pubpkt);
  -_pubfn = _free(_pubfn);
   sigpkt = _free(sigpkt);
  -_sigfn = _free(_sigfn);
  -_fn = _free(_fn);
  -
   dig = pgpDigFree(dig);
   
   if (_debug)
  @@ .
__
RPM Package Managerh

[CVS] RPM: rpm/ CHANGES rpm/lib/ tpgp.c rpm/rpmdb/ pkgio.c

2007-12-28 Thread Jeff Johnson
  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:   29-Dec-2007 00:27:36
  Branch: HEAD Handle: 2007122823273500

  Modified files:
rpm CHANGES
rpm/lib tpgp.c
rpm/rpmdb   pkgio.c

  Log:
- fix: remove unused assertion.
- wire up rpmtsFindPubkey() retrieval (no workie yet).

  Summary:
RevisionChanges Path
1.2034  +1  -0  rpm/CHANGES
2.7 +56 -23 rpm/lib/tpgp.c
1.70+0  -2  rpm/rpmdb/pkgio.c
  

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  
  $ cvs diff -u -r1.2033 -r1.2034 CHANGES
  --- rpm/CHANGES   28 Dec 2007 20:55:14 -  1.2033
  +++ rpm/CHANGES   28 Dec 2007 23:27:35 -  1.2034
  @@ -1,4 +1,5 @@
   5.0b3 -> 5.0b4:
  +- jbj: fix: remove unused assertion.
   - jbj: fix: undo deliberate damage from rpm's RHL8 security audit. 
ptooey!
   - rse: allow assertion of a particular GnuPG signing key via 
"gnupg() = " in dependencies
   - rse: fix invocaction of GnuPG's gpg(1) command for gnupg() 
dependency assertions
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.6 -r2.7 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 22:43:48 -  2.6
  +++ rpm/lib/tpgp.c28 Dec 2007 23:27:35 -  2.7
  @@ -8,7 +8,7 @@
   extern int _pgp_print;
   
   #include "system.h"
  -#include 
  +#include   /* XXX rpmioSlurp */
   #include 
   
   #define  _RPMPGP_INTERNAL
  @@ -23,13 +23,20 @@
   
   #include "genpgp.h"
   
  +#include 
  +
  +#include 
  +#include 
  +#include 
  +#include 
  +
   #include "debug.h"
   
   static
  -int rpmCheckPgpSignatureOnFile(const char * fn, const char * sigfn,
  +int rpmCheckPgpSignatureOnFile(rpmts ts, const char * fn, const char * sigfn,
const char * pubfn, const char * pubfingerprint)
   {
  -pgpDig dig = pgpDigNew(0);
  +pgpDig dig = rpmtsDig(ts);
   pgpDigParams sigp;
   const unsigned char * sigpkt = NULL;
   size_t sigpktlen = 0;
  @@ -61,6 +68,13 @@
goto exit;
   }
   
  +sigp = pgpGetSignature(dig);
  +
  +if (sigp->version != 3 && sigp->version != 4) {
  +fprintf(stderr, "==> unverifiable V%d\n", sigp->version);
  + goto exit;
  +}
  +
   /* Load the pubkey. Use pubfn if specified, otherwise rpmdb keyring. */
   if (pubfn != NULL) {
const char * _pubfn = rpmExpand(pubfn, NULL);
  @@ -71,27 +85,25 @@
goto exit;
}
_pubfn = _free(_pubfn);
  -} else {
  -}
  -xx = pgpPrtPkts((uint8_t *)pubpkt, pubpktlen, dig, printing);
  -if (xx) {
  + xx = pgpPrtPkts((uint8_t *)pubpkt, pubpktlen, dig, printing);
  + if (xx) {
   fprintf(stderr, "==> pgpPrtPkts PUB %p[%u] ret %d\n", pubpkt, pubpktlen, xx);
  - goto exit;
  -}
  -
  -sigp = pgpGetSignature(dig);
  -
  -if (sigp->version != 3 && sigp->version != 4) {
  -fprintf(stderr, "==> unverifiable V%d\n", sigp->version);
  - goto exit;
  + goto exit;
  + }
  +} else {
  + rpmRC res = rpmtsFindPubkey(ts, dig);
  + if (res != RPMRC_OK) {
  +fprintf(stderr, "==> rpmtsFindPubkey ret %d\n", res);
  + goto exit;
  + }
   }
   
   /* Compute the message digest. */
   ctx = rpmDigestInit(sigp->hash_algo, RPMDIGEST_NONE);
   
   {const char * _fn = rpmExpand(fn, NULL);
  - const char * b = NULL;
  - size_t blen = 0;
  + uint8_t * b = NULL;
  + ssize_t blen = 0;
int _rc = rpmioSlurp(_fn, &b, &blen);
   
if (!(_rc == 0 && b != NULL && blen > 0)) {
  @@ -150,7 +162,7 @@
   exit:
   pubpkt = _free(pubpkt);
   sigpkt = _free(sigpkt);
  -dig = pgpDigFree(dig);
  +rpmtsCleanDig(ts);
   
   if (_debug)
   fprintf(stderr, " verify: rc %d\n", rc);
  @@ -159,35 +171,56 @@
   }
   
   static
  -int doit(const char * sigtype)
  +int doit(rpmts ts, const char * sigtype)
   {
   int rc = 0;
   
   if (!strcmp("DSA", sigtype)) {
  - rc = rpmCheckPgpSignatureOnFile("plaintext", DSAsig, DSApub, NULL);
  + rc = rpmCheckPgpSignatureOnFile(ts, "plaintext", DSAsig, DSApub, NULL);
  + rc = rpmCheckPgpSignatureOnFile(ts, "plaintext", DSAsig, NULL, NULL);
   }
   if (!strcmp("RSA", sigtype)) {
  - rc = rpmCheckPgpSignatureOnFile("plaintext", RSAsig, RSApub, NULL);
  + rc = rpmCheckPgpSignatureOnFile(ts, "plaintext", RSAsig, RSApub, NULL);
  + rc 

[CVS] RPM: rpm/lib/ genpgp.sh rpmts.c tpgp.c

2007-12-28 Thread Jeff Johnson
  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:   29-Dec-2007 03:49:32
  Branch: HEAD Handle: 2007122902493200

  Modified files:
rpm/lib genpgp.sh rpmts.c tpgp.c

  Log:
- jbj: hmmm, RSA V4 pubkey keyid's differ from gpg --list-public-keys.
- jbj: functional DSA rpmtsFindPubkey implicit retrieve w pubfn == NULL
- jbj: use ts->pkpkt just like rpmtsFindPubkey() does.
- jbj: check for pubkey_algo and (DSA only) keyid match.
- jbj: generate armored RSA.pub and DSA.pub correctly.

  Summary:
RevisionChanges Path
2.4 +2  -2  rpm/lib/genpgp.sh
2.133   +1  -2  rpm/lib/rpmts.c
2.8 +28 -8  rpm/lib/tpgp.c
  

  patch -p0 <<'@@ .'
  Index: rpm/lib/genpgp.sh
  
  $ cvs diff -u -r2.3 -r2.4 genpgp.sh
  --- rpm/lib/genpgp.sh 28 Dec 2007 19:54:51 -  2.3
  +++ rpm/lib/genpgp.sh 29 Dec 2007 02:49:32 -  2.4
  @@ -27,7 +27,7 @@
   
   $gpg --detach-sign -a -u DSApub --output - plaintext > DSA.sig
   $gpg --clearsign -u DSApub --output - plaintext > DSA.pem
  -$gpg --export -a -u DSApub > DSA.pub
  +$gpg --export -a DSApub > DSA.pub
   
   echo "static const char * DSAsig = \"DSA.sig\";"
   echo "static const char * DSApem = \"DSA.pem\";"
  @@ -35,7 +35,7 @@
   
   $gpg --detach-sign -a -u RSApub --output - plaintext > RSA.sig
   $gpg --clearsign -u RSApub --output - plaintext > RSA.pem
  -$gpg --export -a -u RSApub > RSA.pub
  +$gpg --export -a RSApub > RSA.pub
   
   echo "static const char * RSAsig = \"RSA.sig\";"
   echo "static const char * RSApem = \"RSA.pem\";"
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmts.c
  
  $ cvs diff -u -r2.132 -r2.133 rpmts.c
  --- rpm/lib/rpmts.c   16 Dec 2007 23:24:00 -  2.132
  +++ rpm/lib/rpmts.c   29 Dec 2007 02:49:32 -  2.133
  @@ -666,8 +666,7 @@
   /[EMAIL PROTECTED] =voidabstract @*/
   ts->orderAlloced = 0;
   
  -if (ts->pkpkt != NULL)
  - ts->pkpkt = _free(ts->pkpkt);
  +ts->pkpkt = _free(ts->pkpkt);
   ts->pkpktlen = 0;
   memset(ts->pksignid, 0, sizeof(ts->pksignid));
   
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/tpgp.c
  
  $ cvs diff -u -r2.7 -r2.8 tpgp.c
  --- rpm/lib/tpgp.c28 Dec 2007 23:27:35 -  2.7
  +++ rpm/lib/tpgp.c29 Dec 2007 02:49:32 -  2.8
  @@ -23,6 +23,7 @@
   
   #include "genpgp.h"
   
  +#define  _RPMTS_INTERNAL /* XXX ts->pkpkt */
   #include 
   
   #include 
  @@ -38,10 +39,9 @@
   {
   pgpDig dig = rpmtsDig(ts);
   pgpDigParams sigp;
  +pgpDigParams pubp;
   const unsigned char * sigpkt = NULL;
   size_t sigpktlen = 0;
  -const unsigned char * pubpkt = NULL;
  -size_t pubpktlen = 0;
   DIGEST_CTX ctx = NULL;
   int printing = 0;
   int rc = 0;
  @@ -61,6 +61,7 @@
}
_sigfn = _free(_sigfn);
   } else {
  + /* XXX FIXME: read clearsign'd file with appended signature.
   }
   xx = pgpPrtPkts((uint8_t *)sigpkt, sigpktlen, dig, printing);
   if (xx) {
  @@ -78,26 +79,44 @@
   /* Load the pubkey. Use pubfn if specified, otherwise rpmdb keyring. */
   if (pubfn != NULL) {
const char * _pubfn = rpmExpand(pubfn, NULL);
  - xx = pgpReadPkts(_pubfn, &pubpkt, &pubpktlen);
  + xx = pgpReadPkts(_pubfn, &ts->pkpkt, &ts->pkpktlen);
if (xx != PGPARMOR_PUBKEY) {
  -fprintf(stderr, "==> pgpReadPkts(%s) PUB %p[%u] ret %d\n", _pubfn, pubpkt, 
pubpktlen, xx);
  +fprintf(stderr, "==> pgpReadPkts(%s) PUB %p[%u] ret %d\n", _pubfn, 
ts->pkpkt, ts->pkpktlen, xx);
_pubfn = _free(_pubfn);
goto exit;
}
_pubfn = _free(_pubfn);
  - xx = pgpPrtPkts((uint8_t *)pubpkt, pubpktlen, dig, printing);
  + xx = pgpPrtPkts((uint8_t *)ts->pkpkt, ts->pkpktlen, dig, printing);
if (xx) {
  -fprintf(stderr, "==> pgpPrtPkts PUB %p[%u] ret %d\n", pubpkt, pubpktlen, xx);
  +fprintf(stderr, "==> pgpPrtPkts PUB %p[%u] ret %d\n", ts->pkpkt, 
ts->pkpktlen, xx);
goto exit;
}
   } else {
  - rpmRC res = rpmtsFindPubkey(ts, dig);
  + rpmRC res = pgpFindPubkey(dig);
if (res != RPMRC_OK) {
   fprintf(stderr, "==> rpmtsFindPubkey ret %d\n", res);
goto exit;
}
   }
   
  +pubp = pgpGetPubkey(dig);
  +
  +/* Do the parameters match the signature? */
  +if (!(sigp->pubkey_algo == pubp->pubkey_algo
  +#