From 5f3e39a3b08c7d42d23a18a3e5e950e099bc8c57 Mon Sep 17 00:00:00 2001 From: Guus Sliepen Date: Fri, 3 May 2019 00:24:29 +0200 Subject: [PATCH] Ensure we can pass arbitrary binary blobs for keys. --- src/meshlink.c | 4 ++-- src/meshlink.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 } -- 2.39.5