blob: 240742602c19946cbb7cf87923750ca802b932a1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
/*
* (C) 2017 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
#include <botan/exceptn.h>
namespace Botan {
Exception::Exception(const std::string& msg) : m_msg(msg)
{}
Exception::Exception(const char* prefix, const std::string& msg) :
m_msg(std::string(prefix) + " " + msg)
{}
Invalid_Argument::Invalid_Argument(const std::string& msg) :
Exception("Invalid argument", msg)
{}
Invalid_Argument::Invalid_Argument(const std::string& msg, const std::string& where) :
Exception("Invalid argument", msg + " in " + where)
{}
Lookup_Error::Lookup_Error(const std::string& type,
const std::string& algo,
const std::string& provider) :
Exception("Unavailable " + type + " " + algo +
(provider.empty() ? std::string("") : (" for provider " + provider)))
{}
Internal_Error::Internal_Error(const std::string& err) :
Exception("Internal error: " + err)
{}
Invalid_Key_Length::Invalid_Key_Length(const std::string& name, size_t length) :
Invalid_Argument(name + " cannot accept a key of length " +
std::to_string(length))
{}
Invalid_IV_Length::Invalid_IV_Length(const std::string& mode, size_t bad_len) :
Invalid_Argument("IV length " + std::to_string(bad_len) +
" is invalid for " + mode)
{}
Policy_Violation::Policy_Violation(const std::string& err) :
Invalid_State("Policy violation: " + err) {}
PRNG_Unseeded::PRNG_Unseeded(const std::string& algo) :
Invalid_State("PRNG not seeded: " + algo)
{}
Algorithm_Not_Found::Algorithm_Not_Found(const std::string& name) :
Lookup_Error("Could not find any algorithm named \"" + name + "\"")
{}
No_Provider_Found::No_Provider_Found(const std::string& name) :
Exception("Could not find any provider for algorithm named \"" + name + "\"")
{}
Provider_Not_Found::Provider_Not_Found(const std::string& algo, const std::string& provider) :
Lookup_Error("Could not find provider '" + provider + "' for " + algo)
{}
Invalid_Algorithm_Name::Invalid_Algorithm_Name(const std::string& name):
Invalid_Argument("Invalid algorithm name: " + name)
{}
Encoding_Error::Encoding_Error(const std::string& name) :
Invalid_Argument("Encoding error: " + name)
{}
Decoding_Error::Decoding_Error(const std::string& name) :
Invalid_Argument("Decoding error: " + name)
{}
Integrity_Failure::Integrity_Failure(const std::string& msg) :
Exception("Integrity failure: " + msg)
{}
Invalid_OID::Invalid_OID(const std::string& oid) :
Decoding_Error("Invalid ASN.1 OID: " + oid)
{}
Stream_IO_Error::Stream_IO_Error(const std::string& err) :
Exception("I/O error: " + err)
{}
Self_Test_Failure::Self_Test_Failure(const std::string& err) :
Internal_Error("Self test failed: " + err)
{}
Not_Implemented::Not_Implemented(const std::string& err) :
Exception("Not implemented", err)
{}
}
|