From: root Date: Thu, 20 Jun 1996 15:55:35 +0000 (+0000) Subject: fixed up for new signature styles X-Git-Tag: tznext/4.11.0.1.tizen20130304~11297 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7617f677bf35c3a9c0620ec8b64b3ba02eaeeb8a;p=tools%2Flibrpm-tizen.git fixed up for new signature styles CVS patchset: 663 CVS date: 1996/06/20 15:55:35 --- diff --git a/checksig.c b/checksig.c index 4a25723..6270df4 100644 --- a/checksig.c +++ b/checksig.c @@ -120,7 +120,7 @@ int doReSign(char *passPhrase, char **argv) return 0; } -int doCheckSig(char **argv) +int doCheckSig(int pgp, char **argv) { int fd; struct rpmlead lead; @@ -152,22 +152,41 @@ int doCheckSig(char **argv) continue; } - xres = verifySignature(fd, lead.signature_type, sig, result); - if (!xres) { + xres = verifySignature(fd, lead.signature_type, sig, result, pgp); + if (xres == RPMSIG_SIGOK) { if (isVerbose()) { printf("%s: %s", rpm, result); } - printf("%s: Signature OK.\n", rpm); + switch (lead.signature_type) { + case RPMSIG_PGP262_1024: + printf("%s: (Old PGP) Signature OK.\n", rpm); + break; + case RPMSIG_MD5: + printf("%s: (MD5) Signature OK.\n", rpm); + break; + case RPMSIG_MD5_PGP: + if (pgp) { + printf("%s: (MD5 PGP) Signature OK.\n", rpm); + } else { + printf("%s: (MD5 [PGP skipped]) Signature OK.\n", rpm); + } + break; + } } else { if (isVerbose()) { fprintf(stderr, "%s: %s", rpm, result); } - if (xres == RPMSIG_NOSIG) { + if (xres & RPMSIG_NOSIG) { fprintf(stderr, "%s: No signature available.\n", rpm); - } else if (xres == RPMSIG_UNKNOWNSIG) { + } else if (xres & RPMSIG_UNKNOWNSIG) { fprintf(stderr, "%s: Unknown signature type.\n", rpm); + } else if (xres & RPMSIG_BADMD5) { + fprintf(stderr, "%s: (MD5) Signature NOT OK!\n", rpm); + } else if (xres & RPMSIG_BADPGP) { + fprintf(stderr, "%s: (PGP) Signature NOT OK!\n", rpm); } else { - fprintf(stderr, "%s: Signature NOT OK!\n", rpm); + fprintf(stderr, "%s: (Internal error) Signature NOT OK!\n", + rpm); } res = -1; } diff --git a/checksig.h b/checksig.h index a6884e4..0bf91f4 100644 --- a/checksig.h +++ b/checksig.h @@ -1,7 +1,7 @@ #ifndef H_CHECKSIG #define H_CHECKSIG -int doCheckSig(char **argv); +int doCheckSig(int pgp, char **argv); int doReSign(char *passPhrase, char **argv);