summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f788fbc)
Author: noodles
Date: 2002/11/15 15:29:40
Make getfullkeyid in keydb.c not assert if the key isn't found.
* @keyid: The 32bit keyid.
*
* This function maps a 32bit key id to the full 64bit one. It returns the
* @keyid: The 32bit keyid.
*
* This function maps a 32bit key id to the full 64bit one. It returns the
+ * full keyid. If the key isn't found a keyid of 0 is returned.
*/
uint64_t getfullkeyid(uint64_t keyid)
{
*/
uint64_t getfullkeyid(uint64_t keyid)
{
if (keyid < 0x100000000LL) {
fetch_key(keyid, &publickey, false);
if (keyid < 0x100000000LL) {
fetch_key(keyid, &publickey, false);
- keyid = get_keyid(publickey);
- free_publickey(publickey);
+ if (publickey != NULL) {
+ keyid = get_keyid(publickey);
+ free_publickey(publickey);
+ publickey = NULL;
+ } else {
+ keyid = 0;
+ }
* @keyid: The 32bit keyid.
*
* This function maps a 32bit key id to the full 64bit one. It returns the
* @keyid: The 32bit keyid.
*
* This function maps a 32bit key id to the full 64bit one. It returns the
+ * full keyid. If the key isn't found a keyid of 0 is returned.
*/
uint64_t getfullkeyid(uint64_t keyid);
*/
uint64_t getfullkeyid(uint64_t keyid);