This is an automated email from the ASF dual-hosted git repository. yangzhg pushed a commit to branch libhdfs3 in repository https://gitbox.apache.org/repos/asf/doris-thirdparty.git
The following commit(s) were added to refs/heads/libhdfs3 by this push: new 860d7f8 fix some complile warnings (#51) 860d7f8 is described below commit 860d7f8035b610b0d6f9b83720c6f1fd7c9668de Author: Zhengguo Yang <yangz...@gmail.com> AuthorDate: Tue Apr 11 14:15:56 2023 +0800 fix some complile warnings (#51) --- src/client/CryptoCodec.cpp | 11 +++++++---- src/client/FileEncryptionInfo.h | 12 ++++++------ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/client/CryptoCodec.cpp b/src/client/CryptoCodec.cpp index 800344e..f6362fc 100644 --- a/src/client/CryptoCodec.cpp +++ b/src/client/CryptoCodec.cpp @@ -51,13 +51,17 @@ namespace Hdfs { } CryptoCodec::CryptoCodec(FileEncryptionInfo *encryptionInfo, shared_ptr<KmsClientProvider> kcp, int32_t bufSize) : - encryptionInfo(encryptionInfo), kcp(kcp), bufSize(bufSize) + kcp(kcp), encryptionInfo(encryptionInfo), bufSize(bufSize) { // Init global status ERR_load_crypto_strings(); OpenSSL_add_all_algorithms(); + #if OPENSSL_VERSION_NUMBER < 0x10100000L OPENSSL_config(NULL); + #else + OPENSSL_init_crypto(OPENSSL_INIT_LOAD_CONFIG, NULL); + #endif // Create cipher context cipherCtx = EVP_CIPHER_CTX_new(); @@ -128,7 +132,7 @@ namespace Hdfs { return -1; } - LOG(DEBUG3, "CryptoCodec init success, length of the decrypted key is : %llu, crypto method is : %d", AlgorithmBlockSize, crypto_method); + LOG(DEBUG3, "CryptoCodec init success, length of the decrypted key is : %lu, crypto method is : %d", AlgorithmBlockSize, crypto_method); return 1; } @@ -150,7 +154,6 @@ namespace Hdfs { } else { LOG(WARNING, "CryptoCodec : Invalid stream_offset %" PRId64, stream_offset); return -1; - } // Judge the crypto method is encrypt or decrypt. @@ -190,7 +193,7 @@ namespace Hdfs { // If the encode/decode buffer size larger than crypto buffer size, encode/decode buffer one by one while (remaining > bufSize) { - ret = EVP_CipherUpdate(cipherCtx, (unsigned char *) &out_buf[offset], &len, + ret = EVP_CipherUpdate(cipherCtx, (unsigned char *) &out_buf[offset], &len, (const unsigned char *)in_buf.data() + offset, bufSize); if (!ret) { diff --git a/src/client/FileEncryptionInfo.h b/src/client/FileEncryptionInfo.h index a6dea99..d5118c6 100644 --- a/src/client/FileEncryptionInfo.h +++ b/src/client/FileEncryptionInfo.h @@ -28,8 +28,8 @@ namespace Hdfs { class FileEncryptionInfo { public: - FileEncryptionInfo() : - suite(0), cryptoProtocolVersion(0){ + FileEncryptionInfo() : + suite(0), cryptoProtocolVersion(0) { } int getSuite() const { @@ -66,12 +66,12 @@ public: const std::string & getIv() const{ return iv; - } + } void setIv(const std::string & iv){ this->iv = iv; } - + const std::string & getEzKeyVersionName() const{ return ezKeyVersionName; } @@ -81,12 +81,12 @@ public: } private: - int cryptoProtocolVersion; int suite; + int cryptoProtocolVersion; std::string key; std::string iv; std::string keyName; - std::string ezKeyVersionName; + std::string ezKeyVersionName; }; } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org