diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-17 14:42:28 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-17 15:48:15 +0100 |
commit | b7e037820eecc1d3dd22579c2822881d92024cb2 (patch) | |
tree | 28c312d0b2cf918b8bdd98e811f05d344821417f /src/modules | |
parent | 1024143cf4444ccea7a79bf8f219a95a8d4ebf83 (diff) | |
download | gnix-b7e037820eecc1d3dd22579c2822881d92024cb2.tar gnix-b7e037820eecc1d3dd22579c2822881d92024cb2.tar.bz2 gnix-b7e037820eecc1d3dd22579c2822881d92024cb2.tar.zst |
cookie auth: store timestamp big endian
Diffstat (limited to 'src/modules')
-rw-r--r-- | src/modules/auth/cookie.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/auth/cookie.rs b/src/modules/auth/cookie.rs index fbc54c8..de4c76f 100644 --- a/src/modules/auth/cookie.rs +++ b/src/modules/auth/cookie.rs @@ -81,7 +81,7 @@ impl Node for CookieAuth { if self.users.authentificate(username, password) { debug!("login success"); let nonce = [(); 12].map(|_| random::<u8>()); - let plaintext = unix_seconds().to_le_bytes(); + let plaintext = unix_seconds().to_be_bytes(); let mut ciphertext = context .state .crypto_key @@ -146,7 +146,7 @@ impl Node for CookieAuth { }, ); if let Ok(plaintext) = plaintext { - let created = u64::from_le_bytes(plaintext[0..8].try_into().unwrap()); + let created = u64::from_be_bytes(plaintext[0..8].try_into().unwrap()); if self .expire |