1
0

Well, actually, let a crypt_hello_get_nonce func return just a "unsigned char *" without a const modifier.

This commit is contained in:
Alexander Andreev 2024-03-24 04:54:59 +04:00
parent 8df5a6344e
commit 98581204e9
Signed by: Arav
GPG Key ID: 25969B23DCB5CA34
2 changed files with 2 additions and 2 deletions

View File

@ -128,7 +128,7 @@ int crypt_hello_verify(const unsigned char *const hello, crypt_key_t *const remo
return 0; 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)); unsigned char *nonce = (unsigned char *)malloc(CRYPT_NONCE_LEN * sizeof(unsigned char));
if (nonce == NULL) if (nonce == NULL)
return NULL; return NULL;

View File

@ -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); 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. // Combines own and remote halves of a nonce depending in a connection direction and returns it.
// It will be of CRYPT_NONCE_LEN length. // 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 // Stores symmetric keys used for a data encryption in both directions
// and a remote public key. // and a remote public key.