DEREncode issue when upgrading from 5.6.3 to 8.2.0.

Bart Vandewoestyne <[email protected]>
Newsgroups gmane.comp.encryption.cryptopp
Message-ID <[email protected]>
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:

https://github.com/weidai11/cryptopp/issues/569

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

-- 
You received this message because you are subscribed to "Crypto++ Users". More information about Crypto++ and this group is available at http://www.cryptopp.com and http://groups.google.com/forum/#!forum/cryptopp-users.
--- 
You received this message because you are subscribed to the Google Groups "Crypto++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/cryptopp-users/5e8af775-99ad-44f5-93e3-786089584297n%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.