Changeset d8024c7 in git


Ignore:
Timestamp:
2012-03-10T23:45:46Z (13 years ago)
Author:
Zooko O'Whielacronx <zooko@…>
Branches:
master
Children:
cc5dd8d
Parents:
cfb4972
Message:

catch C++ exception from malformed verifying key and convert it to Python exception

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified src/pycryptopp/publickey/rsamodule.cpp

    rcfb4972 rd8024c7  
    329329    StringSource ss(reinterpret_cast<const byte*>(serializedverifyingkey), serializedverifyingkeysize, true);
    330330
    331     verifier->k = new RSASS<PSS, SHA256>::Verifier(ss);
     331    try {
     332        verifier->k = new RSASS<PSS, SHA256>::Verifier(ss);
     333    } catch (CryptoPP::BERDecodeErr le) {
     334        return PyErr_Format(rsa_error, "Serialized verifying key was corrupted.  Crypto++ gave this exception: %s", le.what());
     335    }
     336
    332337    if (!verifier->k)
    333338        return PyErr_NoMemory();
Note: See TracChangeset for help on using the changeset viewer.