handle no domain separator case in keystore

This commit is contained in:
bunnie 2025-05-21 18:02:43 +08:00
parent 04c7933c87
commit 29017766f4
2 changed files with 2 additions and 0 deletions

View file

@ -77,6 +77,7 @@ impl fmt::Display for KeywrapError {
KeywrapError::InvalidKekSize => f.write_str("Invalid key size"),
KeywrapError::InvalidOutputSize => f.write_str("Invalid output size"),
KeywrapError::IntegrityCheckFailed => f.write_str("Authentication failed"),
KeywrapError::NoDomainSeperator => f.write_str("Missing domain separator"),
KeywrapError::UpgradeToNew((_k, _wk)) => {
f.write_str("Legacy migration detected! New wrapped key transmitted to caller")
}

View file

@ -29,6 +29,7 @@ pub enum KeywrapError {
InvalidKekSize,
InvalidOutputSize,
IntegrityCheckFailed,
NoDomainSeperator,
/// this is a bodge to return an error code that upgrades from a faulty early version of AES-KWP
/// only works for 256-bit keys, but that is also all we used.
/// The return tuple is: (unwrapped key, correctly wrapped key)