summaryrefslogtreecommitdiff
path: root/code/util/util.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2017-07-17 21:36:47 +0200
committerUros Majstorovic <majstor@majstor.org>2017-07-17 21:36:47 +0200
commit37f628a88d800123dbad003b122322e8181c3baa (patch)
tree92e97f0fdf7d8a03e8ac379af951ecf3593340d8 /code/util/util.c
parent06f74eed2686a9cab4191908c3fd30f0c15a380b (diff)
seq added to msg handler
Diffstat (limited to 'code/util/util.c')
-rw-r--r--code/util/util.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/code/util/util.c b/code/util/util.c
index e07748b..af47079 100644
--- a/code/util/util.c
+++ b/code/util/util.c
@@ -9,7 +9,7 @@ int ecp_util_key_save(ECPContext *ctx, ECPDHKey *key, char *filename) {
int fd;
ssize_t rv;
- if((fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR)) < 0) return ECP_ERR;
+ if ((fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR)) < 0) return ECP_ERR;
rv = write(fd, ctx->cr.dh_pub_get_buf(&key->public), ECP_ECDH_SIZE_KEY);
if (rv != ECP_ECDH_SIZE_KEY) {
close(fd);
@@ -29,7 +29,7 @@ int ecp_util_key_load(ECPContext *ctx, ECPDHKey *key, char *filename) {
ssize_t rv;
unsigned char buf[ECP_ECDH_SIZE_KEY];
- if((fd = open(filename, O_RDONLY)) < 0) return ECP_ERR;
+ if ((fd = open(filename, O_RDONLY)) < 0) return ECP_ERR;
rv = read(fd, buf, ECP_ECDH_SIZE_KEY);
if (rv != ECP_ECDH_SIZE_KEY) {
close(fd);
@@ -52,7 +52,7 @@ int ecp_util_node_save(ECPContext *ctx, ECPNode *node, char *filename) {
int fd;
ssize_t rv;
- if((fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR)) < 0) return ECP_ERR;
+ if ((fd = open(filename, O_WRONLY | O_CREAT, S_IRUSR | S_IWUSR)) < 0) return ECP_ERR;
rv = write(fd, ctx->cr.dh_pub_get_buf(&node->public), ECP_ECDH_SIZE_KEY);
if (rv != ECP_ECDH_SIZE_KEY) {
close(fd);
@@ -72,7 +72,7 @@ int ecp_util_node_load(ECPContext *ctx, ECPNode *node, char *filename) {
ssize_t rv;
unsigned char buf[ECP_ECDH_SIZE_KEY];
- if((fd = open(filename, O_RDONLY)) < 0) return ECP_ERR;
+ if ((fd = open(filename, O_RDONLY)) < 0) return ECP_ERR;
rv = read(fd, buf, ECP_ECDH_SIZE_KEY);
if (rv != ECP_ECDH_SIZE_KEY) {
close(fd);