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
//! Error types for `opensaml`.
/// Errors produced by the `opensaml` Service Provider library.
#[derive(Debug, thiserror::Error)]
#[non_exhaustive]
pub enum OpenSamlError {
/// Raw DEFLATE (de)compression failed.
#[error("deflate error: {0}")]
Deflate(#[from] std::io::Error),
/// Base64 decoding failed.
#[error("base64 decode error: {0}")]
Base64(#[from] base64::DecodeError),
/// Malformed or unexpected XML.
#[error("xml error: {0}")]
Xml(String),
/// Input failed validation.
#[error("invalid input: {0}")]
Invalid(String),
/// Functionality not yet implemented in the current milestone.
#[error("unsupported: {0}")]
Unsupported(String),
/// Issuer in the message does not match the one declared in metadata.
#[error("ERR_UNMATCH_ISSUER")]
UnmatchIssuer,
/// `<Audience>` does not include this Service Provider's entity ID.
#[error("ERR_UNMATCH_AUDIENCE")]
UnmatchAudience,
/// `InResponseTo` does not match the originating request ID.
#[error("ERR_INVALID_IN_RESPONSE_TO")]
InvalidInResponseTo,
/// Response carried an undefined `<StatusCode>`.
#[error("ERR_UNDEFINED_STATUS")]
UndefinedStatus,
/// Response carried a non-success status (two-tier code).
#[error("ERR_FAILED_STATUS with top tier code: {top}, second tier code: {second}")]
FailedStatus {
/// Top-tier status code.
top: String,
/// Second-tier status code (empty when absent).
second: String,
},
/// `SessionNotOnOrAfter` has elapsed.
#[error("ERR_EXPIRED_SESSION")]
ExpiredSession,
/// Assertion `<Conditions>` time window is invalid.
#[error("ERR_SUBJECT_UNCONFIRMED")]
SubjectUnconfirmed,
/// A signature-wrapping (XSW) attempt was detected.
#[error("ERR_POTENTIAL_WRAPPING_ATTACK")]
PotentialWrappingAttack,
/// Signed redirect/simpleSign message is missing `Signature`/`SigAlg`.
#[error("ERR_MISSING_SIG_ALG")]
MissingSigAlg,
/// Detached (redirect/simpleSign) message signature failed verification.
#[error("ERR_FAILED_MESSAGE_SIGNATURE_VERIFICATION")]
FailedMessageSignatureVerification,
/// XML-DSig signature failed verification.
#[error("FAILED_TO_VERIFY_SIGNATURE")]
FailedToVerifySignature,
/// Certificate in the message does not match the metadata declaration.
#[error("ERROR_UNMATCH_CERTIFICATE_DECLARATION_IN_METADATA")]
UnmatchCertificate,
/// Requested protocol binding is not supported.
#[error("ERR_UNDEFINED_BINDING")]
UndefinedBinding,
/// Required metadata (endpoint/certificate) was missing.
#[error("missing metadata: {0}")]
MissingMetadata(String),
/// A required cryptographic key was missing.
#[error("missing key: {0}")]
MissingKey(String),
/// A delegated cryptographic operation failed.
#[error("crypto error: {0}")]
Crypto(String),
}