summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/rpmdb.c6
-rw-r--r--lib/rpmts.c4
-rw-r--r--python/header-py.c5
3 files changed, 6 insertions, 9 deletions
diff --git a/lib/rpmdb.c b/lib/rpmdb.c
index 6b0272a1b..0a8774129 100644
--- a/lib/rpmdb.c
+++ b/lib/rpmdb.c
@@ -1257,8 +1257,7 @@ static int miFreeHeader(rpmdbMatchIterator mi, dbiIndex dbi)
memset(&data, 0, sizeof(data));
key.data = (void *) &mi->mi_prevoffset;
key.size = sizeof(mi->mi_prevoffset);
- data.data = headerUnload(mi->mi_h);
- data.size = headerSizeof(mi->mi_h, HEADER_MAGIC_NO);
+ data.data = headerExport(mi->mi_h, &data.size);
/* Check header digest/signature on blob export (if requested). */
if (mi->mi_hdrchk && mi->mi_ts) {
@@ -2652,8 +2651,7 @@ int rpmdbAdd(rpmdb db, Header h)
memset(&hdr, 0, sizeof(hdr));
- hdr.size = headerSizeof(h, HEADER_MAGIC_NO);
- hdr.data = headerUnload(h);
+ hdr.data = headerExport(h, &hdr.size);
hdrOk = (hdr.data != NULL && hdr.size > 0);
if (!hdrOk) {
diff --git a/lib/rpmts.c b/lib/rpmts.c
index 111879b1d..25ce83da7 100644
--- a/lib/rpmts.c
+++ b/lib/rpmts.c
@@ -423,8 +423,8 @@ static int makePubkeyHeader(rpmts ts, rpmPubkey key, Header * hdrp)
h = headerReload(h, RPMTAG_HEADERIMMUTABLE);
if (h != NULL) {
char *sha1 = NULL;
- const void *blob = headerUnload(h);
- size_t blen = headerSizeof(h, HEADER_MAGIC_NO);
+ unsigned int blen = 0;
+ const void *blob = headerExport(h, &blen);
/* XXX FIXME: bah, this code is repeated in way too many places */
DIGEST_CTX ctx = rpmDigestInit(PGPHASHALGO_SHA1, RPMDIGEST_NONE);
diff --git a/python/header-py.c b/python/header-py.c
index ba6a94934..96cf20001 100644
--- a/python/header-py.c
+++ b/python/header-py.c
@@ -150,7 +150,7 @@ static PyObject * hdrAsBytes(hdrObject * s, int legacy)
{
PyObject *res = NULL;
char *buf = NULL;
- size_t len;
+ unsigned int len;
Header h = headerLink(s->h);
/* XXX this legacy switch is a hack, needs to be removed. */
@@ -158,8 +158,7 @@ static PyObject * hdrAsBytes(hdrObject * s, int legacy)
h = headerCopy(s->h); /* XXX strip region tags, etc */
headerFree(s->h);
}
- len = headerSizeof(h, HEADER_MAGIC_NO);
- buf = headerUnload(h);
+ buf = headerExport(h, &len);
h = headerFree(h);
if (buf == NULL || len == 0) {