From: Guus Sliepen Date: Thu, 2 May 2019 22:24:29 +0000 (+0200) Subject: Ensure we can pass arbitrary binary blobs for keys. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=5f3e39a3b08c7d42d23a18a3e5e950e099bc8c57;p=meshlink Ensure we can pass arbitrary binary blobs for keys. --- diff --git a/src/meshlink.c b/src/meshlink.c index c5dc33ac..9b13dca1 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -1057,8 +1057,8 @@ bool meshlink_open_params_set_storage_key(meshlink_open_params_t *params, const return true; } -bool meshlink_encrypted_key_rotate(meshlink_handle_t *mesh, const char *new_key, size_t new_keylen) { - if(!mesh || !new_key || !new_keylen || !*new_key) { +bool meshlink_encrypted_key_rotate(meshlink_handle_t *mesh, const void *new_key, size_t new_keylen) { + if(!mesh || !new_key || !new_keylen) { logger(mesh, MESHLINK_ERROR, "Invalid arguments given!\n"); meshlink_errno = MESHLINK_EINVAL; return false; diff --git a/src/meshlink.h b/src/meshlink.h index c8c47184..6a1c758a 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -1187,7 +1187,7 @@ extern void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable); * * @return This function returns true if the key rotation for the encrypted storage succeeds, false otherwise. */ -extern bool meshlink_encrypted_key_rotate(meshlink_handle_t *mesh, const char *new_key, size_t new_keylen); +extern bool meshlink_encrypted_key_rotate(meshlink_handle_t *mesh, const void *new_key, size_t new_keylen); #ifdef __cplusplus }