summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2002-03-06 23:17:31 +0000
committerjbj <devnull@localhost>2002-03-06 23:17:31 +0000
commitc6449e9c4439b7f2cf6c620a78d464b10a6c75b1 (patch)
treeedf6be712b9caa5fd00671f1798dec7399746b78 /rpmio
parent2e2d1cad39b9bf8af73ec7b2c584236aabcdad14 (diff)
downloadlibrpm-tizen-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.tar.gz
librpm-tizen-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.tar.bz2
librpm-tizen-c6449e9c4439b7f2cf6c620a78d464b10a6c75b1.zip
- add header DSA signature.
CVS patchset: 5345 CVS date: 2002/03/06 23:17:31
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/rpmpgp.c14
-rw-r--r--rpmio/rpmpgp.h22
2 files changed, 23 insertions, 13 deletions
diff --git a/rpmio/rpmpgp.c b/rpmio/rpmpgp.c
index 634e5432f..a91cad624 100644
--- a/rpmio/rpmpgp.c
+++ b/rpmio/rpmpgp.c
@@ -560,12 +560,12 @@ int pgpPrtSig(pgpTag tag, const byte *h, unsigned int hlen)
if (_debug && _print)
fprintf(stderr, " hash[%u] -- %s\n", plen, pgpHexStr(p, plen));
- /*@-mods@*/
+/*@-mods@*/
if (_digp && _digp->pubkey_algo == 0) {
- _digp->hashlen = plen;
- _digp->hash = memcpy(xmalloc(plen), p, plen);
+ _digp->hashlen = sizeof(*v) + plen;
+ _digp->hash = memcpy(xmalloc(_digp->hashlen), v, _digp->hashlen);
}
- /*@=mods@*/
+/*@=mods@*/
(void) pgpPrtSubType(p, plen);
p += plen;
@@ -1016,6 +1016,12 @@ struct pgpDig_s * pgpFreeDig(/*@only@*/ /*@null@*/ struct pgpDig_s * dig)
dig->md5 = _free(dig->md5);
/*@-branchstate@*/
+ if (dig->hdrsha1ctx != NULL)
+ (void) rpmDigestFinal(dig->hdrsha1ctx, NULL, NULL, 0);
+ /*@=branchstate@*/
+ dig->hdrsha1ctx = NULL;
+
+ /*@-branchstate@*/
if (dig->sha1ctx != NULL)
(void) rpmDigestFinal(dig->sha1ctx, NULL, NULL, 0);
/*@=branchstate@*/
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index e02394e4a..e7fa0045a 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -10,8 +10,6 @@
* Copyright (C) The Internet Society (1998). All Rights Reserved.
*/
-#undef PACKAGE
-#undef VERSION
#include "base64.h"
#include "dsa.h"
#include "endianness.h"
@@ -975,15 +973,21 @@ struct pgpDig_s {
struct pgpDigParams_s signature;
struct pgpDigParams_s pubkey;
- size_t nbytes; /*!< No. bytes of plain text. */
+ size_t nbytes; /*!< No. bytes of plain text. */
-/*@only@*/ /*@null@*/ DIGEST_CTX sha1ctx;/*!< (dsa) sha1 hash context. */
-/*@only@*/ /*@null@*/ void * sha1; /*!< (dsa) V3 signature hash. */
- size_t sha1len; /*!< (dsa) V3 signature hash length. */
+/*@only@*/ /*@null@*/
+ DIGEST_CTX sha1ctx; /*!< (dsa) sha1 hash context. */
+/*@only@*/ /*@null@*/
+ DIGEST_CTX hdrsha1ctx; /*!< (dsa) header sha1 hash context. */
+/*@only@*/ /*@null@*/
+ void * sha1; /*!< (dsa) V3 signature hash. */
+ size_t sha1len; /*!< (dsa) V3 signature hash length. */
-/*@only@*/ /*@null@*/ DIGEST_CTX md5ctx;/*!< (rsa) md5 hash context. */
-/*@only@*/ /*@null@*/ void * md5; /*!< (rsa) V3 signature hash. */
- size_t md5len; /*!< (rsa) V3 signature hash length. */
+/*@only@*/ /*@null@*/
+ DIGEST_CTX md5ctx; /*!< (rsa) md5 hash context. */
+/*@only@*/ /*@null@*/
+ void * md5; /*!< (rsa) V3 signature hash. */
+ size_t md5len; /*!< (rsa) V3 signature hash length. */
/* DSA parameters. */
mp32barrett p;