While cross machine compatibility is not currently an aim for keyd
we should specify the word size for commands to help down the line
if we decide to do this.
- int cmd = KEYD_CMD_UNKNOWN;
+ uint32_t cmd = KEYD_CMD_UNKNOWN;
ssize_t bytes = 0;
ssize_t count = 0;
int ret = 0;
ssize_t bytes = 0;
ssize_t count = 0;
int ret = 0;
#ifndef __KEYD_H__
#define __KEYD_H__
#ifndef __KEYD_H__
#define __KEYD_H__
#define KEYD_SOCKET "keyd.sock"
enum keyd_ops {
#define KEYD_SOCKET "keyd.sock"
enum keyd_ops {
KEYD_REPLY_UNKNOWN_CMD = 1
};
KEYD_REPLY_UNKNOWN_CMD = 1
};
-static int keyd_version = 2;
+static uint32_t keyd_version = 2;
static void keyd_initdb(bool readonly)
{
struct sockaddr_un sock;
static void keyd_initdb(bool readonly)
{
struct sockaddr_un sock;
- int cmd = KEYD_CMD_UNKNOWN;
- int reply = KEYD_REPLY_UNKNOWN_CMD;
+ uint32_t cmd = KEYD_CMD_UNKNOWN;
+ uint32_t reply = KEYD_REPLY_UNKNOWN_CMD;
ssize_t count;
keyd_fd = socket(PF_UNIX, SOCK_STREAM, 0);
ssize_t count;
keyd_fd = socket(PF_UNIX, SOCK_STREAM, 0);
*/
static void keyd_cleanupdb(void)
{
*/
static void keyd_cleanupdb(void)
{
- int cmd = KEYD_CMD_CLOSE;
+ uint32_t cmd = KEYD_CMD_CLOSE;
if (write(keyd_fd, &cmd, sizeof(cmd)) != sizeof(cmd)) {
logthing(LOGTHING_CRITICAL,
if (write(keyd_fd, &cmd, sizeof(cmd)) != sizeof(cmd)) {
logthing(LOGTHING_CRITICAL,
{
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
{
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
- int cmd = KEYD_CMD_GET;
+ uint32_t cmd = KEYD_CMD_GET;
ssize_t bytes = 0;
ssize_t count = 0;
ssize_t bytes = 0;
ssize_t count = 0;
*/
static int keyd_delete_key(uint64_t keyid, bool intrans)
{
*/
static int keyd_delete_key(uint64_t keyid, bool intrans)
{
- int cmd = KEYD_CMD_DELETE;
+ uint32_t cmd = KEYD_CMD_DELETE;
write(keyd_fd, &cmd, sizeof(cmd));
read(keyd_fd, &cmd, sizeof(cmd));
write(keyd_fd, &cmd, sizeof(cmd));
read(keyd_fd, &cmd, sizeof(cmd));
struct openpgp_packet_list *packets = NULL;
struct openpgp_packet_list *list_end = NULL;
struct openpgp_publickey *next = NULL;
struct openpgp_packet_list *packets = NULL;
struct openpgp_packet_list *list_end = NULL;
struct openpgp_publickey *next = NULL;
- int cmd = KEYD_CMD_STORE;
+ uint32_t cmd = KEYD_CMD_STORE;
uint64_t keyid;
keyid = get_keyid(publickey);
uint64_t keyid;
keyid = get_keyid(publickey);
{
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
{
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
- int cmd = KEYD_CMD_GETTEXT;
+ uint32_t cmd = KEYD_CMD_GETTEXT;
ssize_t bytes = 0;
ssize_t count = 0;
ssize_t bytes = 0;
ssize_t count = 0;
*/
static uint64_t keyd_getfullkeyid(uint64_t keyid)
{
*/
static uint64_t keyd_getfullkeyid(uint64_t keyid)
{
- int cmd = KEYD_CMD_GETFULLKEYID;
+ uint32_t cmd = KEYD_CMD_GETFULLKEYID;
write(keyd_fd, &cmd, sizeof(cmd));
read(keyd_fd, &cmd, sizeof(cmd));
write(keyd_fd, &cmd, sizeof(cmd));
read(keyd_fd, &cmd, sizeof(cmd));
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
struct openpgp_publickey *key = NULL;
struct buffer_ctx keybuf;
struct openpgp_packet_list *packets = NULL;
struct openpgp_publickey *key = NULL;
- int cmd = KEYD_CMD_KEYITER;
+ uint32_t cmd = KEYD_CMD_KEYITER;
ssize_t bytes = 0;
ssize_t count = 0;
int numkeys = 0;
ssize_t bytes = 0;
ssize_t count = 0;
int numkeys = 0;