From 9b971d2fcc745ec06c9e840477cc7e924d6c2db6 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Wed, 16 Aug 2023 07:03:27 +0300 Subject: [PATCH] randomize only the IV part of prefix --- librocksdb-sys/rocksdb/plugin/openssl/openssl_provider.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librocksdb-sys/rocksdb/plugin/openssl/openssl_provider.cc b/librocksdb-sys/rocksdb/plugin/openssl/openssl_provider.cc index 429ef5a..3adfd9d 100644 --- a/librocksdb-sys/rocksdb/plugin/openssl/openssl_provider.cc +++ b/librocksdb-sys/rocksdb/plugin/openssl/openssl_provider.cc @@ -270,7 +270,7 @@ Status OpensslProvider::AddCipher(const std::string& /*descriptor*/, Status OpensslProvider::CreateNewPrefix(const std::string& /*fname*/, char* prefix, size_t prefixLength) const { - if (1 != RAND_bytes(reinterpret_cast(prefix), static_cast(prefixLength)) ){ + if (1 != RAND_bytes(reinterpret_cast(prefix), static_cast(OpensslCipherStream::kBlockSize)) ){ return handleErrors("Failed to get random numbers.");//Status::Aborted(ERR_reason_error_string(ERR_get_error())); } //if( 1 != EVP_CIPHER_up_ref(aes_cipher_)) return handleErrors("Failed to create OpensslCipherStream.");