Skip to content

Commit

Permalink
Use endian-specific access functions in ssl.c
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Jan 26, 2015
1 parent 49e191f commit 6a2f8ea
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions ssl.c
Expand Up @@ -622,8 +622,7 @@ int keystore_fetch(const char *key, unsigned char **result)
}
len = strlen(key);
buf[0] = 'g';
buf[1] = len >> 8;
buf[2] = len & 0xff;
store_be16(buf + 1, len);

if (send(fd, buf, 3, 0) != 3 || send(fd, key, len, 0) != len ||
shutdown(fd, SHUT_WR) || recv(fd, buf, 1, 0) != 1)
Expand All @@ -636,7 +635,7 @@ int keystore_fetch(const char *key, unsigned char **result)
}
if (recv(fd, buf, 2, 0) != 2)
goto out;
len = (buf[0] << 8) + buf[1];
len = load_be16(buf);
data = malloc(len);
if (!data)
goto out;
Expand Down

0 comments on commit 6a2f8ea

Please sign in to comment.