X-Git-Url: https://the.earth.li/gitweb/?a=blobdiff_plain;f=gpgwww.c;h=0fc58fb3762f1b40b539e8bf80cd1352a8f7a149;hb=c063c72b0e63842f5466e0983183c98d4e05c54e;hp=6615887cf753ca29d24f4984b6c9822cbb3f2d05;hpb=8e0907be1d73011075a99a0c029c56664e12843e;p=onak.git diff --git a/gpgwww.c b/gpgwww.c index 6615887..0fc58fb 100644 --- a/gpgwww.c +++ b/gpgwww.c @@ -13,8 +13,7 @@ * more details. * * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., 51 - * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * this program. If not, see . */ #include @@ -22,6 +21,8 @@ #include #include +#include "build-config.h" + #include "armor.h" #include "charfuncs.h" #include "cleanup.h" @@ -33,7 +34,6 @@ #include "onak-conf.h" #include "parsekey.h" #include "stats.h" -#include "version.h" #define OP_UNKNOWN 0 #define OP_GET 1 @@ -69,22 +69,18 @@ int getkeyspath(struct onak_dbctx *dbctx, struct openpgp_packet_list *packets = NULL; struct openpgp_packet_list *list_end = NULL; struct stats_key *keyinfoa, *keyinfob, *curkey; - uint64_t fullhave, fullwant; int pathlen = 0; - fullhave = dbctx->getfullkeyid(dbctx, have); - fullwant = dbctx->getfullkeyid(dbctx, want); - /* * Make sure the keys we have and want are in the cache. */ - dbctx->cached_getkeysigs(dbctx, fullhave); - dbctx->cached_getkeysigs(dbctx, fullwant); + dbctx->cached_getkeysigs(dbctx, have); + dbctx->cached_getkeysigs(dbctx, want); - if ((keyinfoa = findinhash(fullhave)) == NULL) { + if ((keyinfoa = findinhash(have)) == NULL) { return 1; } - if ((keyinfob = findinhash(fullwant)) == NULL) { + if ((keyinfob = findinhash(want)) == NULL) { return 1; } @@ -104,7 +100,7 @@ int getkeyspath(struct onak_dbctx *dbctx, */ curkey = findinhash(keyinfoa->parent); while (curkey != NULL && curkey->keyid != 0) { - if (curkey->keyid != fullwant && + if (curkey->keyid != want && dbctx->fetch_key_id(dbctx, curkey->keyid, &publickey, false)) { @@ -126,7 +122,7 @@ int getkeyspath(struct onak_dbctx *dbctx, /* * Add the destination key to the list of returned keys. */ - if (dbctx->fetch_key_id(dbctx, fullwant, &publickey, false)) { + if (dbctx->fetch_key_id(dbctx, want, &publickey, false)) { flatten_publickey(publickey, &packets, &list_end); @@ -173,7 +169,7 @@ int main(int argc, char *argv[]) "\">Find reverse path\n", to, from); - printf("" "Get all keys listed

\n", from, @@ -183,7 +179,7 @@ int main(int argc, char *argv[]) readconfig(NULL); initlogthing("gpgwww", config.logfile); catchsignals(); - dbctx = config.dbinit(true); + dbctx = config.dbinit(config.backend, true); inithash(); logthing(LOGTHING_NOTICE, "Looking for path from 0x%016" PRIX64 " to 0x%016"