aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/utils/exceptn.h
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-10-26 20:31:30 -0400
committerJack Lloyd <[email protected]>2017-10-26 22:26:15 -0400
commite6d45052efedfe49e99adb6318aaf56e0a9e8d7b (patch)
treec6c3ccd3cff3d04285940bf1d518c809e0653947 /src/lib/utils/exceptn.h
parent315b002ecf00f6b6bb0f0d5200d1f39a83527e8f (diff)
Add checks that keyed algorithms are actually keyed before use
Previously calling update or encrypt without calling set_key first would result in invalid outputs or else crashing.
Diffstat (limited to 'src/lib/utils/exceptn.h')
-rw-r--r--src/lib/utils/exceptn.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/utils/exceptn.h b/src/lib/utils/exceptn.h
index b9b94a8f8..e82889b5a 100644
--- a/src/lib/utils/exceptn.h
+++ b/src/lib/utils/exceptn.h
@@ -62,6 +62,12 @@ class BOTAN_PUBLIC_API(2,0) Invalid_State : public Exception
explicit Invalid_State(const std::string& err) : Exception(err) {}
};
+class BOTAN_PUBLIC_API(2,4) Key_Not_Set : public Invalid_State
+ {
+ public:
+ explicit Key_Not_Set(const std::string& algo);
+ };
+
/**
* Lookup_Error Exception
*/