diff options
Diffstat (limited to 'src/lib/pubkey')
-rw-r--r-- | src/lib/pubkey/dlies/dlies.cpp | 2 | ||||
-rw-r--r-- | src/lib/pubkey/ecies/ecies.cpp | 2 | ||||
-rw-r--r-- | src/lib/pubkey/mceies/mceies.cpp | 2 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_privatekey.cpp | 5 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_privatekey.h | 6 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_publickey.cpp | 4 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_signature.cpp | 4 | ||||
-rw-r--r-- | src/lib/pubkey/xmss/xmss_verification_operation.cpp | 2 |
8 files changed, 12 insertions, 15 deletions
diff --git a/src/lib/pubkey/dlies/dlies.cpp b/src/lib/pubkey/dlies/dlies.cpp index aa214fd8b..d24542d0e 100644 --- a/src/lib/pubkey/dlies/dlies.cpp +++ b/src/lib/pubkey/dlies/dlies.cpp @@ -192,7 +192,7 @@ secure_vector<uint8_t> DLIES_Decryptor::do_decrypt(uint8_t& valid_mask, try { // the decryption can fail: - // e.g. Integrity_Failure is thrown if GCM is used and the message does not have a valid tag + // e.g. Invalid_Authentication_Tag is thrown if GCM is used and the message does not have a valid tag if(m_iv.size()) { diff --git a/src/lib/pubkey/ecies/ecies.cpp b/src/lib/pubkey/ecies/ecies.cpp index 54055de7a..fb12eaa49 100644 --- a/src/lib/pubkey/ecies/ecies.cpp +++ b/src/lib/pubkey/ecies/ecies.cpp @@ -399,7 +399,7 @@ secure_vector<uint8_t> ECIES_Decryptor::do_decrypt(uint8_t& valid_mask, const ui try { // the decryption can fail: - // e.g. Integrity_Failure is thrown if GCM is used and the message does not have a valid tag + // e.g. Invalid_Authentication_Tag is thrown if GCM is used and the message does not have a valid tag secure_vector<uint8_t> decrypted_data(encrypted_data.begin(), encrypted_data.end()); m_cipher->finish(decrypted_data); return decrypted_data; diff --git a/src/lib/pubkey/mceies/mceies.cpp b/src/lib/pubkey/mceies/mceies.cpp index 3f8562e17..4d62889fe 100644 --- a/src/lib/pubkey/mceies/mceies.cpp +++ b/src/lib/pubkey/mceies/mceies.cpp @@ -97,7 +97,7 @@ mceies_decrypt(const McEliece_PrivateKey& privkey, aead->finish(pt, 0); return pt; } - catch(Integrity_Failure&) + catch(Invalid_Authentication_Tag&) { throw; } diff --git a/src/lib/pubkey/xmss/xmss_privatekey.cpp b/src/lib/pubkey/xmss/xmss_privatekey.cpp index 05d61981e..9ef2b5c9c 100644 --- a/src/lib/pubkey/xmss/xmss_privatekey.cpp +++ b/src/lib/pubkey/xmss/xmss_privatekey.cpp @@ -37,7 +37,7 @@ XMSS_PrivateKey::XMSS_PrivateKey(const secure_vector<uint8_t>& raw_key) if(raw_key.size() != size()) { - throw Integrity_Failure("Invalid XMSS private key size detected."); + throw Decoding_Error("Invalid XMSS private key size detected."); } // extract & copy unused leaf index from raw_key. @@ -52,8 +52,7 @@ XMSS_PrivateKey::XMSS_PrivateKey(const secure_vector<uint8_t>& raw_key) if(unused_leaf >= (1ull << XMSS_PublicKey::m_xmss_params.tree_height())) { - throw Integrity_Failure("XMSS private key leaf index out of " - "bounds."); + throw Decoding_Error("XMSS private key leaf index out of bounds"); } begin = end; diff --git a/src/lib/pubkey/xmss/xmss_privatekey.h b/src/lib/pubkey/xmss/xmss_privatekey.h index d66933724..e3b41617c 100644 --- a/src/lib/pubkey/xmss/xmss_privatekey.h +++ b/src/lib/pubkey/xmss/xmss_privatekey.h @@ -115,8 +115,7 @@ class BOTAN_PUBLIC_API(2,0) XMSS_PrivateKey final : public virtual XMSS_PublicKe { if(idx >= (1ull << XMSS_PublicKey::m_xmss_params.tree_height())) { - throw Integrity_Failure("XMSS private key leaf index out of " - "bounds."); + throw Decoding_Error("XMSS private key leaf index out of bounds"); } else { @@ -140,8 +139,7 @@ class BOTAN_PUBLIC_API(2,0) XMSS_PrivateKey final : public virtual XMSS_PublicKe *recover_global_leaf_index())).fetch_add(1); if(idx >= (1ull << XMSS_PublicKey::m_xmss_params.tree_height())) { - throw Integrity_Failure("XMSS private key, one time signatures " - "exhausted."); + throw Decoding_Error("XMSS private key, one time signatures exhaused"); } return idx; } diff --git a/src/lib/pubkey/xmss/xmss_publickey.cpp b/src/lib/pubkey/xmss/xmss_publickey.cpp index 425c657ca..42fbdb851 100644 --- a/src/lib/pubkey/xmss/xmss_publickey.cpp +++ b/src/lib/pubkey/xmss/xmss_publickey.cpp @@ -26,7 +26,7 @@ XMSS_PublicKey::XMSS_PublicKey(const std::vector<uint8_t>& raw_key) { if(raw_key.size() < size()) { - throw Integrity_Failure("Invalid XMSS public key size detected."); + throw Decoding_Error("Invalid XMSS public key size detected."); } // extract & copy root from raw key. @@ -49,7 +49,7 @@ XMSS_PublicKey::deserialize_xmss_oid(const std::vector<uint8_t>& raw_key) { if(raw_key.size() < 4) { - throw Integrity_Failure("XMSS signature OID missing."); + throw Decoding_Error("XMSS signature OID missing."); } // extract and convert algorithm id to enum type diff --git a/src/lib/pubkey/xmss/xmss_signature.cpp b/src/lib/pubkey/xmss/xmss_signature.cpp index f2d1ba4f1..2ba8a1965 100644 --- a/src/lib/pubkey/xmss/xmss_signature.cpp +++ b/src/lib/pubkey/xmss/xmss_signature.cpp @@ -19,7 +19,7 @@ XMSS_Signature::XMSS_Signature(XMSS_Parameters::xmss_algorithm_t oid, if(raw_sig.size() != (xmss_params.len() + xmss_params.tree_height() + 1) * xmss_params.element_size() + sizeof(m_leaf_idx)) { - throw Integrity_Failure("XMSS signature size invalid."); + throw Decoding_Error("XMSS signature size invalid."); } for(size_t i = 0; i < 8; i++) @@ -27,7 +27,7 @@ XMSS_Signature::XMSS_Signature(XMSS_Parameters::xmss_algorithm_t oid, if(m_leaf_idx >= (1ull << xmss_params.tree_height())) { - throw Integrity_Failure("XMSS signature leaf index out of bounds."); + throw Decoding_Error("XMSS signature leaf index out of bounds."); } auto begin = raw_sig.begin() + sizeof(m_leaf_idx); diff --git a/src/lib/pubkey/xmss/xmss_verification_operation.cpp b/src/lib/pubkey/xmss/xmss_verification_operation.cpp index 6a757633e..2eacc19fd 100644 --- a/src/lib/pubkey/xmss/xmss_verification_operation.cpp +++ b/src/lib/pubkey/xmss/xmss_verification_operation.cpp @@ -117,7 +117,7 @@ bool XMSS_Verification_Operation::is_valid_signature(const uint8_t sig[], m_msg_buf.clear(); return result; } - catch(Integrity_Failure&) + catch(...) { m_msg_buf.clear(); return false; |