summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Schroeder <mls@suse.de>2013-10-30 13:08:07 +0100
committerMichael Schroeder <mls@suse.de>2013-10-30 13:08:07 +0100
commitf603326a75e0a2c375a99d665e5735666670b250 (patch)
tree1293e69db51d964facd448596712fd9ba8801314
parentf1d93ea9b8f70178b37492d71df67a17261a0976 (diff)
downloadlibsolv-f603326a75e0a2c375a99d665e5735666670b250.tar.gz
libsolv-f603326a75e0a2c375a99d665e5735666670b250.tar.bz2
libsolv-f603326a75e0a2c375a99d665e5735666670b250.zip
make keyid of master key available in subkeys
-rw-r--r--ext/repo_pubkey.c8
-rw-r--r--src/knownid.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/ext/repo_pubkey.c b/ext/repo_pubkey.c
index 13c4c8c..6371274 100644
--- a/ext/repo_pubkey.c
+++ b/ext/repo_pubkey.c
@@ -502,6 +502,7 @@ parsepubkey(Solvable *s, Repodata *data, unsigned char *p, int pl, int flags)
unsigned char *pstart = p;
int tag, l;
unsigned char keyid[8];
+ char subkeyofstr[17];
unsigned int kcr = 0, maxex = 0, maxsigcr = 0;
unsigned char *pubkey = 0;
int pubkeyl = 0;
@@ -511,6 +512,7 @@ parsepubkey(Solvable *s, Repodata *data, unsigned char *p, int pl, int flags)
unsigned char *pubdata = 0;
int pubdatal = 0;
+ *subkeyofstr = 0;
for (; ; p += l, pl -= l)
{
int hl = parsepkgheader(p, pl, &tag, &l);
@@ -543,6 +545,8 @@ parsepubkey(Solvable *s, Repodata *data, unsigned char *p, int pl, int flags)
sprintf(evr + 8, "-%08x", maxsigcr);
s->evr = pool_str2id(repo->pool, evr, 1);
}
+ if (insubkey && *subkeyofstr)
+ repodata_set_str(data, s - repo->pool->solvables, PUBKEY_SUBKEYOF, subkeyofstr);
if (pubdata) /* set data blob */
repodata_set_binary(data, s - repo->pool->solvables, PUBKEY_DATA, pubdata, pubdatal);
if (!pl)
@@ -554,6 +558,8 @@ parsepubkey(Solvable *s, Repodata *data, unsigned char *p, int pl, int flags)
}
if (tag == 6 || (tag == 14 && !(flags & ADD_WITH_SUBKEYS)))
break;
+ if (tag == 14 && pubdata && !insubkey)
+ solv_bin2hex(keyid, 8, subkeyofstr);
/* create new solvable for subkey */
s = pool_id2solvable(repo->pool, repo_add_solvable(repo));
}
@@ -570,6 +576,8 @@ parsepubkey(Solvable *s, Repodata *data, unsigned char *p, int pl, int flags)
}
else
insubkey = 1;
+ pubdata = 0;
+ pubdatal = 0;
if (p[0] == 3 && l >= 10)
{
unsigned int ex;
diff --git a/src/knownid.h b/src/knownid.h
index ba4d71b..e7d8ad5 100644
--- a/src/knownid.h
+++ b/src/knownid.h
@@ -256,6 +256,8 @@ KNOWNID(SIGNATURE_TIME, "signature:time"),
KNOWNID(SIGNATURE_EXPIRES, "signature:expires"),
KNOWNID(SIGNATURE_DATA, "signature:data"),
+KNOWNID(PUBKEY_SUBKEYOF, "pubkey:subkeyof"),
+
KNOWNID(ID_NUM_INTERNAL, 0)
#ifdef KNOWNID_INITIALIZE