Define OpenPGP constants and use them rather than magic numbers
[onak.git] / keydb.c
diff --git a/keydb.c b/keydb.c
index 42eebfe3a34c8b1e0ee4bc0c6b1c9ed9bafa0914..2abfa02bae51ae8a9d8d7b3f587844b66c4b29ca 100644 (file)
--- a/keydb.c
+++ b/keydb.c
@@ -23,6 +23,7 @@
 #include "keystructs.h"
 #include "mem.h"
 #include "merge.h"
+#include "openpgp.h"
 #include "parsekey.h"
 #include "sendsync.h"
 
@@ -42,7 +43,7 @@ char *generic_keyid2uid(uint64_t keyid)
                        publickey != NULL) {
                curuid = publickey->uids;
                while (curuid != NULL && buf[0] == 0) {
-                       if (curuid->packet->tag == 13) {
+                       if (curuid->packet->tag == OPENPGP_PACKET_UID) {
                                snprintf(buf, 1023, "%.*s",
                                                (int) curuid->packet->length,
                                                curuid->packet->data);
@@ -185,7 +186,7 @@ int generic_update_keys(struct openpgp_publickey **keys, bool sendsync)
        for (curkey = *keys; curkey != NULL; curkey = curkey->next) {
                intrans = config.dbbackend->starttrans();
                logthing(LOGTHING_INFO,
-                       "Fetching key 0x%llX, result: %d",
+                       "Fetching key 0x%" PRIX64 ", result: %d",
                        get_keyid(curkey),
                        config.dbbackend->fetch_key(get_keyid(curkey), &oldkey,
                                        intrans));