c++11 - Botan 1.10.9 SecureVector to std::vector bad_alloc -


i have strange error in botan 1.10.9. when want store private key bytes vector , publics key byte vector std::bad_alloc error. not possible initialize std::vector securevector botan?

botan::libraryinitializer init;  botan::autoseeded_rng rng; rng.reseed(10096);  botan::rsa_privatekey rsaprivate(rng, 1024);  std::vector<unsigned char> privatearray(rsaprivate.pkcs8_private_key().begin(), rsaprivate.pkcs8_private_key().end()); std::vector<unsigned char> publicarray(rsaprivate.x509_subject_public_key().begin(), rsaprivate.x509_subject_public_key().end()); 

if encode keys, operation works fine:

botan::securevector<botan::byte> publicbytes  = std::move(botan::x509::ber_encode(rsaprivate)); botan::securevector<botan::byte> privatebytes = std::move(botan::pkcs8::ber_encode(rsaprivate, rng, info.passphrase()));  std::vector<unsigned char> publicarray(publicbytes.begin(), publicbytes.end()); std::vector<unsigned char> privatearray(privatebytes.begin(), privatebytes.end()); 

any ideas why happening? weird thing if remove 1 of vectors initialization, soooooometimes works of time crash.


Comments

Popular posts from this blog

cakephp - simple blog with croogo -

How to group boxplot outliers in gnuplot -

bash - Performing variable substitution in a string -