#1000205 Package: libcrypto++8

Package:
libcrypto++8
Source:
libcrypto++
Description:
General purpose cryptographic library - shared library
Submitter:
Jurij Ivastsuk-Kienbaum
Date:
2021-11-20 12:57:03 UTC
Severity:
normal
#1000205#5
Date:
2021-11-19 16:49:15 UTC
From:
To:
Package: libcrypto++8:amd64  8.6.0-2

I am developing a program that encrypts and decrypts data using
libcrypto++ library.
I send you a fragment of pseudo code where a bug  can reproduced if
using libcrypto++8 (8.6.0-2) version (in Debian-11):
------------------------------------------------------------------------------------------------------------------------------------------------------
Bytef* crypted_data;    //buffer filed with encrypted data 16432 byte
stringstream ost, oost;
unsigned int crypted_block_size = 16432;
string s_salt =
"T716cPzRRPXB43O0VJ7ByQKT6iDXehk6jxHEqfd2Frk53Mfn3h27lJF4HxFlA80uhlCBOkPGhEQb1ZORDNvdui6qAZdcdUYpNmI0AJIxmddHTUWy798Fywvlm3IXbhlg";
const char* c_salt = s_salt.c_str();
unsigned int i;

for (i = 0; i < crypted_block_size; i++)
{
     ost.put(crypted_data[i]);
}

(libcrypto++6:amd64  5.6.4-7): OK, no problem
DecryptFile(istream& ost, ostream& oost, const char* c_salt)
(libcrypto++6:amd64  5.6.4-10): OK, no problem
{
(libcrypto++8:amd64  8.6.0-2):
     FileSource f(ost, true, new DefaultDecryptorWithMAC(c_salt, new
FileSink(oost))); --->     Terminate called after throwing an instance
of 'CryptoPP::KeyBadErr'
what():  DataDecryptor: cannot decrypt message with this passphrase
}
------------------------------------------------------------------------------------------------------------------------------------------------------

Whereas in two previous versions of this library ("libcrypto++6:amd64
5.6.4-7"(Debian-9) and "libcrypto++6:amd64 5.6.4-10"(Debian-10)) at the
same point in the code with the same data no error occurred.

I suggest that the, function DefaultDecryptorWithMAC() in libcrypto++8
be corrected.

I am using Debian GNU/Linux 11, kernel 5.14.0-2-amd64 and
libcrypto++8:amd64 8.6.0-2.

Regards,
Jurij