lderr(cct) << __func__ << " failed decoding of frame header: " << e
<< dendl;
_fault();
- } catch (const SHA256SignatureError &e) {
+ } catch (const ceph::crypto::onwire::MsgAuthError &e) {
lderr(cct) << __func__ << " " << e.what() << dendl;
_fault();
} catch (const DecryptionError &) {
data = session_stream_handlers.rx->authenticated_decrypt_update(
std::move(data), segment_t::DEFAULT_ALIGNMENT);
}
- session_stream_handlers.rx->authenticated_decrypt_update_final(
- std::move(extra), segment_t::DEFAULT_ALIGNMENT);
+ try {
+ session_stream_handlers.rx->authenticated_decrypt_update_final(
+ std::move(extra), segment_t::DEFAULT_ALIGNMENT);
+ } catch (ceph::crypto::onwire::MsgAuthError &e) {
+ ldout(cct, 5) << __func__ << " message authentication failed: "
+ << e.what() << dendl;
+ return _fault();
+ }
}
Message *message = decode_message(cct, messenger->crcflags, header, footer,
<< " plainbl.length()=" << plainbl.length()
<< " final_len=" << final_len
<< dendl;
- throw std::runtime_error("EVP_DecryptFinal_ex failed");
+ throw MsgAuthError();
} else {
ceph_assert_always(final_len == 0);
ceph_assert_always(plainbl.length() + final_len + AESGCM_TAG_LEN == cnt_len);
namespace ceph::crypto::onwire {
+struct MsgAuthError : public std::runtime_error {
+ MsgAuthError()
+ : runtime_error("message signature mismatch") {
+ }
+};
+
struct TxHandler {
virtual ~TxHandler() = default;
bool crossed);
};
-
} // namespace ceph::crypto::onwire
#endif // CEPH_CRYPTO_ONWIRE_H