From ff1e40c3d83e66e1a4abbc03cf8b15ad1a8c403f Mon Sep 17 00:00:00 2001 From: Xavrax Date: Thu, 12 Oct 2023 14:31:19 +0200 Subject: [PATCH] owning? --- cpp/pubnub_common.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/pubnub_common.hpp b/cpp/pubnub_common.hpp index 4007f385..3471c8cc 100644 --- a/cpp/pubnub_common.hpp +++ b/cpp/pubnub_common.hpp @@ -637,7 +637,7 @@ class crypto_module: public into_crypto_provider_ptr { * * @see pubnub_crypto_aes_cbc_module_init */ - static crypto_module aes_cbc(std::string cipher_key) + static crypto_module aes_cbc(std::string& cipher_key) { return crypto_module(pubnub_crypto_aes_cbc_module_init((uint8_t*)(cipher_key.c_str()))); } @@ -651,7 +651,7 @@ class crypto_module: public into_crypto_provider_ptr { * * @see pubnub_crypto_legacy_module_init */ - static crypto_module legacy(std::string cipher_key) + static crypto_module legacy(std::string& cipher_key) { return crypto_module(pubnub_crypto_legacy_module_init((uint8_t*)(cipher_key.c_str()))); } @@ -690,7 +690,7 @@ class crypto_module: public into_crypto_provider_ptr { to_decrypt.push_back('\0'); pubnub_bymebl_t to_decrypt_c; to_decrypt_c.ptr = to_decrypt.data(); - to_decrypt_c.size = to_decrypt.size() - 1; + to_decrypt_c.size = to_decrypt.size(); pubnub_bymebl_t result = this->d_module->decrypt(this->d_module, to_decrypt_c); to_decrypt.pop_back();