summaryrefslogtreecommitdiff
path: root/ext/repo_pubkey.c
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-07-25 18:07:21 +0200
committerMichael Schroeder <mls@suse.de>2013-07-25 18:07:21 +0200
commite5c0fd85e44c6956b6abbf666bfe9a880f86db87 (patch)
treed33060be2de68cc23acacf17b5f5cf91543b02fa /ext/repo_pubkey.c
parent2dc8749cfe3f7a0bdb4847c18eaf6655c736d8f5 (diff)
downloadlibsolv-e5c0fd85e44c6956b6abbf666bfe9a880f86db87.tar.gz
libsolv-e5c0fd85e44c6956b6abbf666bfe9a880f86db87.tar.bz2
libsolv-e5c0fd85e44c6956b6abbf666bfe9a880f86db87.zip
treat v4 self-sig without key expires as unlimited lifetime
Diffstat (limited to 'ext/repo_pubkey.c')
-rw-r--r--ext/repo_pubkey.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/ext/repo_pubkey.c b/ext/repo_pubkey.c
index 61ae880..7b196cb 100644
--- a/ext/repo_pubkey.c
+++ b/ext/repo_pubkey.c
@@ -262,6 +262,7 @@ parsesigpacket(struct gpgsig *sig, unsigned char *p, int l, unsigned char *pubke
return;
sig->type = p[1];
q = p + 4;
+ sig->keyexpires = -1;
for (j = 0; q && j < 2; j++)
{
if (q + 2 > p + l)
@@ -539,8 +540,13 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl)
if (solv_pgpvrfy(pubdata, pubdatal, sig.sigdata, sig.sigdatal))
#endif
{
- if (!maxex && sig.keyexpires)
- maxex = sig.keyexpires + kcr;
+ if (sig.keyexpires && maxex != -1)
+ {
+ if (sig.keyexpires == -1)
+ maxex = -1;
+ else if (sig.keyexpires + kcr > maxex)
+ maxex = sig.keyexpires + kcr;
+ }
if (sig.created > maxsigcr)
maxsigcr = sig.created;
}
@@ -571,7 +577,7 @@ parsekeydata(Solvable *s, Repodata *data, unsigned char *p, int pl)
}
if (kcr)
repodata_set_num(data, s - s->repo->pool->solvables, SOLVABLE_BUILDTIME, kcr);
- if (maxex)
+ if (maxex && maxex != -1)
repodata_set_num(data, s - s->repo->pool->solvables, PUBKEY_EXPIRES, maxex);
s->name = pool_str2id(s->repo->pool, "gpg-pubkey", 1);
s->evr = 1;