From 0fb9b31b7cf349314bc61f70e021f92876af63b8 Mon Sep 17 00:00:00 2001 From: "Dan S. Camper" Date: Mon, 6 Jan 2025 12:28:19 -0600 Subject: [PATCH] Update --- ecllibrary/teststd/Crypto/TestCrypto_SKE.ecl | 5 +++++ plugins/cryptolib/cryptolib.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ecllibrary/teststd/Crypto/TestCrypto_SKE.ecl b/ecllibrary/teststd/Crypto/TestCrypto_SKE.ecl index faf5c7b9d0d..08c179c4b86 100644 --- a/ecllibrary/teststd/Crypto/TestCrypto_SKE.ecl +++ b/ecllibrary/teststd/Crypto/TestCrypto_SKE.ecl @@ -38,5 +38,10 @@ EXPORT TestCrypto_SKE := MODULE EXPORT DATA dat2 := mod.Encrypt( (DATA)'0123456789~`!@#$%^&*()-_=+|][}{;:?.>,<'); EXPORT TS05 := ASSERT(mod.Decrypt(dat2) = (DATA)'0123456789~`!@#$%^&*()-_=+|][}{;:?.>,<'); END; + + EXPORT TestSKE05 := MODULE // HPCC-33157 + EXPORT mod := Std.Crypto.SymmetricEncryption('aes-256-cbc', '01234567890123456789012345678901'); + EXPORT TS05 := ASSERT(mod.Decrypt((DATA)'') = (DATA)''); + END; END; diff --git a/plugins/cryptolib/cryptolib.cpp b/plugins/cryptolib/cryptolib.cpp index abd97cdd8b1..0123d3ae5fb 100644 --- a/plugins/cryptolib/cryptolib.cpp +++ b/plugins/cryptolib/cryptolib.cpp @@ -158,6 +158,10 @@ static void symmDeserialize(size32_t lenPBuffer, const void * pBuffer, StringBuf sbCipher.append(len, finger);//extract cipher name } + else + { + *lenPlainText = 0; + } } static void symmSerialize(void * & result, size32_t & lenResult, const char * pIV, size32_t lenIV, size32_t lenPlainText, size32_t lenCipherBuff, const void * pCipherBuff)