- md5 sums are little endian (no swap) so big endian needs the swap.
authorjbj <devnull@localhost>
Thu, 16 Nov 2000 22:55:10 +0000 (22:55 +0000)
committerjbj <devnull@localhost>
Thu, 16 Nov 2000 22:55:10 +0000 (22:55 +0000)
CVS patchset: 4285
CVS date: 2000/11/16 22:55:10

CHANGES
lib/install.c
rpmio/digest.c

diff --git a/CHANGES b/CHANGES
index 8fe0f09..d692fb0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -33,6 +33,8 @@
        - fix: duplicate headerFree() on installBinaryPackage() error return.
        - fix: segfault on exit of "rpm -qp --qf '%{#fsnames}' pkg" (#20595).
        - hpux w/o -D_OPEN_SOURCE has not h_errno.
+       - syntax to specify source of Requires: (PreReq: now legacy).
+       - md5 sums are little endian (no swap) so big endian needs the swap.
 
 3.0.6 -> 4.0
        - use DIRNAMES/BASENAMES/DIRINDICES not FILENAMES in packages and db.
index ab09021..ce77bca 100644 (file)
@@ -556,6 +556,9 @@ static void callback(struct cpioCallbackInfo * cpioInfo, void * data)
 
 /**
  * Setup payload map and install payload archive.
+ *
+ * @todo Add endian tag so that srpm MD5 sums can ber verified when installed.
+ *
  * @param fd           file handle of package (positioned at payload)
  * @param files                files to install (NULL means "all files")
  * @param fileCount    no. files to install
@@ -610,7 +613,13 @@ static int installArchive(FD_t fd, struct fileInfo * files, int fileCount,
 #else
            urltype = urlPath(files[i].relativePath, &map[mappedFiles].fsPath);
 #endif
-           map[mappedFiles].md5sum = files[i].md5sum;
+           /* XXX Can't do src rpm MD5 sum verification yet. */
+           map[mappedFiles].md5sum =
+               specFile == NULL ? files[i].md5sum : NULL;
+           /* XXX Can't do src rpm MD5 sum verification (yet). */
+    /* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */
+           map[mappedFiles].md5sum = headerIsEntry(h, RPMTAG_SOURCERPM)
+                       ?  files[i].md5sum : NULL;
            map[mappedFiles].finalMode = files[i].mode;
            map[mappedFiles].finalUid = files[i].uid;
            map[mappedFiles].finalGid = files[i].gid;
index f319879..c3caece 100644 (file)
@@ -407,7 +407,8 @@ rpmDigestInit(rpmDigestFlags flags)
        ctx->digest[ 4 ] = 0xc3d2e1f0;
     }
 
-    ctx->doByteReverse = (IS_BIG_ENDIAN()) ? 0 : 1;
+    /* md5 sums are little endian (no swap) so big endian needs the swap. */
+    ctx->doByteReverse = (IS_BIG_ENDIAN()) ? 1 : 0;
     if (flags & RPMDIGEST_NATIVE)
        ctx->doByteReverse = 0;