summaryrefslogtreecommitdiff
path: root/rpmio/rpmkeyring.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-09Make base64 encoding/decoding part of rpmio public APIPanu Matilainen1-2/+2
- Base64 is present in headers and all, it's only reasonable that our API users have access to this functionality without having to link to other libraries. Even if we didn't want to carry the implementation forever in our codebase, we should provide a wrapping for this (much like the other crypto stuff) for the reason stated above. - A bigger issue is that our dirty little (badly hidden) secret was using non-namespaced function names, clashing with at least beecrypt. And we couldn't have made these internal-only symbols even on platforms that support it, because they are used all over the place outside rpmio. So... rename the b64 functions to rpmLikeNamingStyle and make 'em public. No functional changes, just trivial renaming despite touching numerous places.
2011-11-09Add a signature verification method to keyringPanu Matilainen1-0/+18
- At least within rpm itself, callers aren't particularly interested in the actual key that matches a given signature, they just want simple good/bad/nokey answers. This makes life simple for them and avoids exposing further rpmPubkey internals through APIs.
2011-11-09Split keyring find-by-signature to helper function, document...Panu Matilainen1-16/+31
- Document the broken rpmKeyringLookup() behavior / side-effect, the new helper uses the values from our stored pgp parameters though. - Shouldn't make any difference functionality-wise, but we'll need the helper function shortly.
2011-11-09Parse pubkey parameters on rpmPubkeyNew() already and store resultsPanu Matilainen1-0/+7
- Yet more pre-requisites for separating key and signature management. In addition this gains us more thorough initial sanity checking and will allow reusing the parameters instead of having to parse the same packets over and over again on every single verification against this key. Unfortunately rpmKeyringLookup() is so braindead it prevents us from doing this right now, we'll need a better interface to take advantage of the stored pgp key parameters.
2011-11-08Revert "Take advantage of pgpDigParamsCmp() in rpmKeyringLookup()"Panu Matilainen1-1/+3
- This only "works" because of other brokenness in the sig/key parsing, revert while we can - This reverts commit 4c51eff3f0fa5e67494b6b192aa1c087f57abed6.
2011-11-07Take advantage of pgpDigParamsCmp() in rpmKeyringLookup()Panu Matilainen1-3/+1
- Besides eliminating a couple of direct struct accesses, pgpDigParamsCmp() does a much more thorough job of comparing the parameters than we ever did here (ie less chance for returning ok for for a wrong key, although because the interface is as braindead as it is, it doesn't make a whole lot of difference)
2011-11-07Eliminate direct pgpDig accesses from keyringPanu Matilainen1-6/+6
2011-10-25pgpPubkeyFingerprint() can fail, propagate errors part IIPanu Matilainen1-1/+5
- rpmPubkeyNew() needs to return NULL if we fail to grab the keyid, make it so...
2011-07-13Oops, rpmPubkeyDig() should return NULL if pgpPrtPkts() failsPanu Matilainen1-4/+10
2010-09-13Eliminate all fooUnlink() functions out of the APIPanu Matilainen1-2/+5
- These are internal helpers only, all refcount users need to use fooFree() or similar for correct operation. Add fwd declarations where necessary to avoid moving code around unnecessarily. - We could add these back later as aliases to fooFree() but for now, just get them out of the way.
2008-08-08Add couple of new rpmPubkey() methodsPanu Matilainen1-0/+30
- rpmPubkeyDig() to retrieve parsed OpenPGP parameters of key - rpmPubkeyBase64() to return base64 encoding of the key
2008-07-17Add (and use) refcounting for rpmKeyring and rpmPubkeyPanu Matilainen1-4/+51
2008-07-02Make rpmkeyring.h public headerPanu Matilainen1-1/+1
2008-07-02Some keyring improvementsPanu Matilainen1-12/+37
- keep keyring sorted by keyid, use bsearch for key lookups - check for key in keyring before adding it to avoid dupes - actually check that pubkey parameters match the signature on keyring lookup like was done in rpmtsFindPubkey()
2008-07-01Beginnings of an abstract keyringPanu Matilainen1-0/+120
- in librpmio to avoid dependencies on higher level stuff - for now it's just an in-memory structure that needs to be populated by someone simply by feeding in GPG public keys