int doCheckSig(int pgp, char **argv)
{
- int fd, ofd, res, res2;
+ int fd, ofd, res, res2, res3, missingKeys;
struct rpmlead lead;
char *rpm;
char result[1024], sigtarget[1024];
sigIter = initIterator(sig);
res2 = 0;
+ missingKeys = 0;
if (isVerbose()) {
sprintf(buffer, "%s:\n", rpm);
} else {
if ((tag == SIGTAG_PGP) && !pgp) {
continue;
}
- if (verifySignature(sigtarget, tag, ptr, count, result)) {
+ if ((res3 = verifySignature(sigtarget, tag, ptr, count, result))) {
if (isVerbose()) {
strcat(buffer, result);
+ res2 = 1;
} else {
switch (tag) {
case SIGTAG_SIZE:
strcat(buffer, "SIZE ");
+ res2 = 1;
break;
case SIGTAG_MD5:
strcat(buffer, "MD5 ");
+ res2 = 1;
break;
case SIGTAG_PGP:
- strcat(buffer, "PGP ");
+ if (res3 == RPMSIG_NOKEY) {
+ /* Do not consedier this a failure */
+ strcat(buffer, "(PGP) ");
+ missingKeys = 1;
+ } else {
+ strcat(buffer, "PGP ");
+ res2 = 1;
+ }
break;
default:
strcat(buffer, "!!! ");
+ res2 = 1;
}
}
- res2 = 1;
} else {
if (isVerbose()) {
strcat(buffer, result);
if (isVerbose()) {
fprintf(stderr, "%s", buffer);
} else {
- fprintf(stderr, "%sNOT OK\n", buffer);
+ fprintf(stderr, "%sNOT OK%s\n", buffer,
+ missingKeys ? " (MISSING KEYS)" : "");
}
} else {
if (isVerbose()) {
printf("%s", buffer);
} else {
- printf("%sOK\n", buffer);
+ printf("%sOK%s\n", buffer,
+ missingKeys ? " (MISSING KEYS)" : "");
}
}
}