pub struct RequestHashKey { /* private fields */ }Expand description
HMAC-SHA256 key for the request_hash column (#268).
Derived from the audit key material through AuditKey::request_hash_key;
never constructed from the raw signing seed by any other path. The keying
is what makes an exported request_hash uncrackable: before v4 the column
was one unsalted SHA-256 over the unredacted parameters, so an export let
any holder brute-force low-entropy values such as a Wi-Fi passphrase
offline. An HMAC keeps the preview/execute binding the daemon needs — and
the opacity the offline verifier needs, since verify_rows re-signs the
stored column rather than recomputing it — while removing the ability to
test guesses without the key.
Debug is manual and never renders the key bytes, for the same reason
AuditKey’s is.
Implementations§
Source§impl RequestHashKey
impl RequestHashKey
Sourcepub fn request_hash(&self, action_name: &str, canonical_params: &str) -> String
pub fn request_hash(&self, action_name: &str, canonical_params: &str) -> String
HMAC-SHA256(key, action_name || 0x00 || canonical_params),
hex-encoded: 64 characters, the same width the unsigned hash had, so
the column, the wire format and every length check downstream are
unchanged.
The message framing is byte-identical to the pre-v4 SHA-256; only the
keying changed. That is deliberate — it keeps the two schemes
comparable in tests (request_hash_is_not_the_unsigned_sha256) and
means no caller-visible contract beyond confidentiality moved.
Trait Implementations§
Source§impl Clone for RequestHashKey
impl Clone for RequestHashKey
Auto Trait Implementations§
impl Freeze for RequestHashKey
impl RefUnwindSafe for RequestHashKey
impl Send for RequestHashKey
impl Sync for RequestHashKey
impl Unpin for RequestHashKey
impl UnsafeUnpin for RequestHashKey
impl UnwindSafe for RequestHashKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more