]> the.earth.li Git - onak.git/blobdiff - keydb_file.c
Add support for displaying EC/ECDSA key types
[onak.git] / keydb_file.c
index e1d0b528bc1f06eb08e3fdd473830603d82c1bcf..4321a682ee762e4c51855858fb746851a0ed0fa2 100644 (file)
@@ -128,9 +128,14 @@ static int file_store_key(struct openpgp_publickey *publickey, bool intrans,
        struct openpgp_publickey *next = NULL;
        char keyfile[1024];
        int fd = -1;
+       uint64_t keyid;
 
+       if (get_keyid(publickey, &keyid) != ONAK_E_OK) {
+               logthing(LOGTHING_ERROR, "Couldn't find key ID for key.");
+               return 0;
+       }
        snprintf(keyfile, 1023, "%s/0x%" PRIX64, config.db_dir,
-                       get_keyid(publickey) & 0xFFFFFFFF);
+                       keyid & 0xFFFFFFFF);
        fd = open(keyfile, O_WRONLY | O_CREAT, 0664); // | O_EXLOCK);
 
        if (fd > -1) {