forked from martinthomson/ohttp
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patherr.rs
More file actions
27 lines (26 loc) · 1 KB
/
err.rs
File metadata and controls
27 lines (26 loc) · 1 KB
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
use thiserror::Error;
#[derive(Error, Debug)]
pub enum ServerError {
#[error("Incorrect CBOR encoding in returned private key")]
KMSCBOREncoding,
#[error("Bad CBOR key type, expected P-384(2)")]
KMSCBORKeyType,
#[error("Unexpected field in exported private key from KMS")]
KMSField,
#[error("Bad key identifier in SKR response")]
KMSKeyId,
#[error("Invalid secret exponent in SKR response")]
KMSExponent,
#[error("KMS returned an unexpected status code: {0}")]
KMSUnexpected(u16),
#[error("Max retries reached, giving up. Cannot reach key management service")]
KMSUnreachable,
#[error("Private key missing from SKR response")]
PrivateKeyMissing,
#[error("CVM guest attestation library initialization failure")]
AttestationLibraryInit,
#[error("Guest attestation library failed to decrypt HPKE private key")]
TPMDecryptionFailure,
#[error("SKR for the requested KID has failed in the past 60 seconds, waiting to retry.")]
CachedSKRError,
}