From 98581204e9d9408b5e87107d77475cb048268d17 Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Sun, 24 Mar 2024 04:54:59 +0400 Subject: [PATCH] Well, actually, let a crypt_hello_get_nonce func return just a "unsigned char *" without a const modifier. --- src/crypt.c | 2 +- src/crypt.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/crypt.c b/src/crypt.c index 3231ad9..1f12be8 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, bool is_client) { +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; diff --git a/src/crypt.h b/src/crypt.h index 6faeb1e..ac06b25 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, bool is_client); +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.