summaryrefslogtreecommitdiff
path: root/code/util
diff options
context:
space:
mode:
Diffstat (limited to 'code/util')
-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);