From 4d4c71c5805a4cbdf52297c99e6f20a1afb6e6af Mon Sep 17 00:00:00 2001 From: ewt Date: Thu, 23 Jan 1997 20:55:52 +0000 Subject: [PATCH] allows you to omit md5 signature checks CVS patchset: 1346 CVS date: 1997/01/23 20:55:52 --- checksig.c | 13 +++++++++---- checksig.h | 4 +++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/checksig.c b/checksig.c index 2deaccb..4f10bda 100644 --- a/checksig.c +++ b/checksig.c @@ -133,7 +133,7 @@ int doReSign(int add, char *passPhrase, char **argv) return 0; } -int doCheckSig(int pgp, char **argv) +int doCheckSig(int flags, char **argv) { int fd, ofd, res, res2, res3, missingKeys; struct rpmlead lead; @@ -203,10 +203,15 @@ int doCheckSig(int pgp, char **argv) sprintf(buffer, "%s: ", rpm); } while (headerNextIterator(sigIter, &tag, &type, &ptr, &count)) { - if ((tag == RPMSIGTAG_PGP) && !pgp) { + if ((tag == RPMSIGTAG_PGP) && !(flags & CHECKSIG_PGP)) continue; - } - if ((res3 = rpmVerifySignature(sigtarget, tag, ptr, count, result))) { + else if ((tag == RPMSIGTAG_MD5 || + tag == RPMSIGTAG_LITTLEENDIANMD5) + && !(flags & CHECKSIG_MD5)) + continue; + + if ((res3 = rpmVerifySignature(sigtarget, tag, ptr, count, + result))) { if (rpmIsVerbose()) { strcat(buffer, result); res2 = 1; diff --git a/checksig.h b/checksig.h index 2af89d5..354f9df 100644 --- a/checksig.h +++ b/checksig.h @@ -1,8 +1,10 @@ #ifndef H_CHECKSIG #define H_CHECKSIG -int doCheckSig(int pgp, char **argv); +#define CHECKSIG_PGP (1 << 0) +#define CHECKSIG_MD5 (1 << 1) +int doCheckSig(int flags, char **argv); int doReSign(int add, char *passPhrase, char **argv); #define ADD_SIGNATURE 1 -- 2.7.4