fix token claims creation

This commit is contained in:
bain 2024-06-01 23:44:17 +02:00
parent 3cb7293c36
commit c0b6c9c0f3
Signed by: bain
GPG key ID: 31F0F25E3BED0B9B

View file

@ -136,7 +136,7 @@ pub fn create_id_token_claims(
let choose = |what: &str, from: &[&'static str]| { let choose = |what: &str, from: &[&'static str]| {
let tag = hmac::sign(&mangler, (what.to_owned() + client_id).as_bytes()); let tag = hmac::sign(&mangler, (what.to_owned() + client_id).as_bytes());
let mut bytes: [u8; 4] = [0; 4]; let mut bytes: [u8; 4] = [0; 4];
bytes.copy_from_slice(tag.as_ref()); bytes.copy_from_slice(&tag.as_ref()[..4]);
from[i32::from_le_bytes(bytes) as usize % from.len()] from[i32::from_le_bytes(bytes) as usize % from.len()]
}; };