Hello list,
I am currently upgrading our Crypto++ from 5.6.3 to 8.2.0. We have some code that compiled fine under 5.6.3, but breaks under 8.2.0. To me, it looks like code that creates a Base64 encoded private/public keypair or something:
CryptoPP::RSAES_OAEP_SHA_Decryptor Decryptor(rng, nrOfBits /*, e */);
CryptoPP::Base64Encoder priv(new
CryptoPP::StringSink(privateKey)); // Base64 Encoder
Decryptor.DEREncode(priv);
priv.MessageEnd();
CryptoPP::RSAES_OAEP_SHA_Encryptor Encryptor(Decryptor);
CryptoPP::Base64Encoder pub(new
CryptoPP::StringSink(publicKey)); // Base64 Encoder
Encryptor.DEREncode(pub);
pub.MessageEnd();
The problem is the calls to DEREncode that worked with 5.6.3 but with 8.2.0 give the error:
1>... blabla.../PPKStringEncryption.cpp(32,13): error C2039: 'DEREncode': is not a member of 'CryptoPP::PK_FinalTemplate<CryptoPP::TF_DecryptorImpl<CryptoPP::TF_CryptoSchemeOptions<ALG_INFO,KEYS,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>>>>'
1> with
1> [
1> ALG_INFO=CryptoPP::TF_ES<CryptoPP::RSA,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>,int>,
1> KEYS=CryptoPP::RSA
1> ]
1>...blabla...\ThirdParty\CryptoPP\CryptoPP-custom\pubkey.h(2238): message : see declaration of 'CryptoPP::PK_FinalTemplate<CryptoPP::TF_DecryptorImpl<CryptoPP::TF_CryptoSchemeOptions<ALG_INFO,KEYS,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>>>>'
1> with
1> [
1> ALG_INFO=CryptoPP::TF_ES<CryptoPP::RSA,CryptoPP::OAEP<CryptoPP::SHA1,CryptoPP::P1363_MGF1>,int>,
1> KEYS=CryptoPP::RSA
1> ]
I think it has to do with this GitHub issue about removing AsymmetricAlgorithm::BERDecode:
but since the code is heavily templatized and I do not consider myself a template expert, I don't know with what to replace the DEREncode calls... Any help on that would be appreciated!
Bart