-
-/**
- * getfullkeyid - Maps a 32bit key id to a 64bit one.
- * @keyid: The 32bit keyid.
- *
- * This function maps a 32bit key id to the full 64bit one. It returns the
- * full keyid. If the key isn't found a keyid of 0 is returned.
- */
-static uint64_t keyd_getfullkeyid(struct onak_dbctx *dbctx, uint64_t keyid)
-{
- int keyd_fd = (intptr_t) dbctx->priv;
- uint32_t cmd = KEYD_CMD_GETFULLKEYID;
-
- if (keyd_send_cmd(keyd_fd, KEYD_CMD_GETFULLKEYID)) {
- write(keyd_fd, &keyid, sizeof(keyid));
- read(keyd_fd, &cmd, sizeof(cmd));
- if (cmd != sizeof(keyid)) {
- return 0;
- }
- read(keyd_fd, &keyid, sizeof(keyid));
- }
-
- return keyid;
-}
-