diff --git a/src/crypt.c b/src/crypt.c index 08c5647..6f9db33 100644 --- a/src/crypt.c +++ b/src/crypt.c @@ -128,7 +128,7 @@ int crypt_hello_verify(const unsigned char *const hello, crypt_key_t *const remo return 0; } -const unsigned char *crypt_hello_get_nonce(const unsigned char *const own_hello, const unsigned char *const remote_hello, const bool is_client) { +const unsigned char *crypt_hello_get_nonce(const unsigned char *const own_hello, const unsigned char *const remote_hello, bool is_client) { unsigned char *nonce = (unsigned char *)malloc(CRYPT_NONCE_LEN * sizeof(unsigned char)); if (nonce == NULL) return NULL; @@ -144,7 +144,7 @@ const unsigned char *crypt_hello_get_nonce(const unsigned char *const own_hello, return nonce; } -int crypt_session_init(crypt_session_t *const s, const crypt_key_t *const own, crypt_key_t *const remote, const bool is_client) { +int crypt_session_init(crypt_session_t *const s, const crypt_key_t *const own, crypt_key_t *const remote, bool is_client) { if (is_client) { if (crypto_kx_client_session_keys(s->rx, s->tx, own->kx_pub, own->kx_sec, remote->kx_pub) != 0) { fprintf(stderr, "Failed to instantiate a client session.\n"); diff --git a/src/crypt.h b/src/crypt.h index 85d9862..4df0db7 100644 --- a/src/crypt.h +++ b/src/crypt.h @@ -61,7 +61,7 @@ unsigned char *crypt_hello(const crypt_key_t *const own); int crypt_hello_verify(const unsigned char *const hello, crypt_key_t *const remote); // Combines own and remote halves of a nonce depending in a connection direction and returns it. // It will be of CRYPT_NONCE_LEN length. -const unsigned char *crypt_hello_get_nonce(const unsigned char *const own_hello, const unsigned char *const remote_hello, const bool is_client); +const unsigned char *crypt_hello_get_nonce(const unsigned char *const own_hello, const unsigned char *const remote_hello, bool is_client); // Stores symmetric keys used for a data encryption in both directions // and a remote public key. @@ -74,7 +74,7 @@ typedef struct crypt_session_t { // Derives the symmetric keys for a data encryption using own public and secret and remote's public keys. // // is_client should be set to true if you are the one establishing the connection. -int crypt_session_init(crypt_session_t *const s, const crypt_key_t *const own, crypt_key_t *const remote, const bool is_client); +int crypt_session_init(crypt_session_t *const s, const crypt_key_t *const own, crypt_key_t *const remote, bool is_client); // Securely erase the fields of a crypt_session_t struct. void crypt_session_destroy(crypt_session_t *const s);