diff options
author | Michael Schroeder <mls@suse.de> | 2013-10-30 13:08:07 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2013-10-30 13:08:07 +0100 |
commit | f603326a75e0a2c375a99d665e5735666670b250 (patch) | |
tree | 1293e69db51d964facd448596712fd9ba8801314 /ext | |
parent | f1d93ea9b8f70178b37492d71df67a17261a0976 (diff) | |
download | libsolv-f603326a75e0a2c375a99d665e5735666670b250.tar.gz libsolv-f603326a75e0a2c375a99d665e5735666670b250.tar.bz2 libsolv-f603326a75e0a2c375a99d665e5735666670b250.zip |
make keyid of master key available in subkeys
Diffstat (limited to 'ext')
-rw-r--r-- | ext/repo_pubkey.c | 8 |
1 files changed, 8 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; |