diff options
author | Jack Lloyd <[email protected]> | 2019-08-17 09:04:10 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-08-17 09:04:10 -0400 |
commit | d32f8a4352c013f036e9b2d05946f052119454dc (patch) | |
tree | 09b02519c8653ff6df4712b6dd4d200c15e3db3a /src/lib/pubkey | |
parent | f2238d65a51d4f82475227a5b3391e93beff0d6c (diff) |
Fix python test
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/rsa/rsa.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/pubkey/rsa/rsa.cpp b/src/lib/pubkey/rsa/rsa.cpp index 195c35bcc..5f597b811 100644 --- a/src/lib/pubkey/rsa/rsa.cpp +++ b/src/lib/pubkey/rsa/rsa.cpp @@ -110,6 +110,8 @@ const BigInt& RSA_PublicKey::get_e() const { return m_public->get_e(); } void RSA_PublicKey::init(BigInt&& n, BigInt&& e) { + if(n.is_negative() || n.is_even() || e.is_negative() || e.is_even()) + throw Decoding_Error("Invalid RSA public key parameters"); m_public = std::make_shared<RSA_Public_Data>(std::move(n), std::move(e)); } |