diff options
author | Jack Lloyd <[email protected]> | 2019-01-18 11:37:01 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2019-01-18 11:37:01 -0500 |
commit | b835fdf8fd3910a79ab408660757d9736f82d14d (patch) | |
tree | fbbd8e89d9cf910bc3a9e9ecbfce5ce290b7c8d9 /src/lib/utils/exceptn.h | |
parent | 9ca22335edcb9800158f4691de20fa5d0f9cc849 (diff) |
Rename Integrity_Failure to Invalid_Authentication_Tag
This makes the meaning and usage more clear.
Add a specific error type so invalid tags can be distinguished without
having to catch that specific type.
See also #1813
Diffstat (limited to 'src/lib/utils/exceptn.h')
-rw-r--r-- | src/lib/utils/exceptn.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/lib/utils/exceptn.h b/src/lib/utils/exceptn.h index bfff85618..c4934ed04 100644 --- a/src/lib/utils/exceptn.h +++ b/src/lib/utils/exceptn.h @@ -51,6 +51,8 @@ enum class ErrorType { TLSError, /** An error during an HTTP operation */ HttpError, + /** A message with an invalid authentication tag was detected */ + InvalidTag, /** An error when calling OpenSSL */ OpenSSLError = 200, @@ -264,16 +266,24 @@ class BOTAN_PUBLIC_API(2,0) Provider_Not_Found final : public Lookup_Error /** * An AEAD or MAC check detected a message modification +* +* In versions before 2.10, Invalid_Authentication_Tag was named +* Integrity_Failure, it was renamed to make its usage more clear. */ -class BOTAN_PUBLIC_API(2,0) Integrity_Failure final : public Exception +class BOTAN_PUBLIC_API(2,0) Invalid_Authentication_Tag final : public Exception { public: - explicit Integrity_Failure(const std::string& msg); + explicit Invalid_Authentication_Tag(const std::string& msg); - ErrorType error_type() const noexcept override { return ErrorType::DecodingFailure; } + ErrorType error_type() const noexcept override { return ErrorType::InvalidTag; } }; /** +* For compatability with older versions +*/ +typedef Invalid_Authentication_Tag Integrity_Failure; + +/** * An error occurred while operating on an IO stream */ class BOTAN_PUBLIC_API(2,0) Stream_IO_Error final : public Exception @@ -356,6 +366,8 @@ class BOTAN_PUBLIC_API(2,0) Invalid_OID final : public Decoding_Error /** * Self Test Failure Exception +* +* This exception is no longer used. It will be removed in a future major release. */ class BOTAN_PUBLIC_API(2,0) Self_Test_Failure final : public Internal_Error { @@ -365,6 +377,8 @@ class BOTAN_PUBLIC_API(2,0) Self_Test_Failure final : public Internal_Error /** * No_Provider_Found Exception +* +* This exception is no longer used. It will be removed in a future major release. */ class BOTAN_PUBLIC_API(2,0) No_Provider_Found final : public Exception { @@ -374,6 +388,8 @@ class BOTAN_PUBLIC_API(2,0) No_Provider_Found final : public Exception /** * Policy_Violation Exception +* +* This exception is no longer used. It will be removed in a future major release. */ class BOTAN_PUBLIC_API(2,0) Policy_Violation final : public Invalid_State { @@ -388,6 +404,7 @@ class BOTAN_PUBLIC_API(2,0) Policy_Violation final : public Invalid_State * It might or might not be valid in another context like a standard. * * This exception is no longer used, instead Not_Implemented is thrown. +* It will be removed in a future major release. */ class BOTAN_PUBLIC_API(2,0) Unsupported_Argument final : public Invalid_Argument { |