X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=keydb.c;h=f362b1adddf3e59fc338ea686e9b70c89992b331;hb=a94e29c9a3763f96b1c773f0818b97e4fd0777b0;hp=30a77caf61f912ddf5142aff5669b8d1be2844cc;hpb=eb94eab34a0893fb5b8f78652f338df85f492a9b;p=onak.git diff --git a/keydb.c b/keydb.c index 30a77ca..f362b1a 100644 --- a/keydb.c +++ b/keydb.c @@ -168,7 +168,9 @@ struct ll *generic_cached_getkeysigs(struct onak_dbctx *dbctx, uint64_t keyid) * the DB). Returns the number of entirely new keys added. */ int generic_update_keys(struct onak_dbctx *dbctx, - struct openpgp_publickey **keys, bool sendsync) + struct openpgp_publickey **keys, + struct keyarray *blacklist, + bool sendsync) { struct openpgp_publickey **curkey, *tmp = NULL; struct openpgp_publickey *oldkey = NULL; @@ -179,6 +181,14 @@ int generic_update_keys(struct onak_dbctx *dbctx, curkey = keys; while (*curkey != NULL) { get_fingerprint((*curkey)->publickey, &fp); + if (blacklist && array_find(blacklist, &fp)) { + logthing(LOGTHING_INFO, "Ignoring blacklisted key."); + tmp = *curkey; + *curkey = (*curkey)->next; + tmp->next = NULL; + free_publickey(tmp); + continue; + } intrans = dbctx->starttrans(dbctx);