X-Git-Url: https://the.earth.li/gitweb/?p=onak.git;a=blobdiff_plain;f=keydb_fs.c;h=926960f04cbe9a2f7aec564f094e2d26201d05d2;hp=0bf922f1475a419781226b33dc22e154e4234c63;hb=5cb163e87c7f0717aa94ca281a56e572c2a6c8f3;hpb=fd9ca85878543771a7f09afd821a5a5511e71aea diff --git a/keydb_fs.c b/keydb_fs.c index 0bf922f..926960f 100644 --- a/keydb_fs.c +++ b/keydb_fs.c @@ -394,10 +394,11 @@ static int fs_store_key(struct onak_dbctx *dbctx, /** * delete_key - Given a keyid delete the key from storage. - * @keyid: The keyid to delete. + * @fp: The fingerprint of the key to delete. * @intrans: If we're already in a transaction. */ -static int fs_delete_key(struct onak_dbctx *dbctx, uint64_t keyid, bool intrans) +static int fs_delete_key(struct onak_dbctx *dbctx, + struct openpgp_fingerprint *fp, bool intrans) { static char buffer[PATH_MAX]; int ret; @@ -407,9 +408,11 @@ static int fs_delete_key(struct onak_dbctx *dbctx, uint64_t keyid, bool intrans) struct openpgp_fingerprint *subkeyids = NULL; uint64_t subkeyid; int i = 0; + uint64_t keyid; - if ((keyid >> 32) == 0) - keyid = fs_getfullkeyid(dbctx, keyid); + keyid = fingerprint2keyid(fp); + if (keyid == 0) + return 1; if (!intrans) fs_starttrans(dbctx);