This commit is contained in:
Edward Shen 2021-06-24 10:41:42 -04:00
parent 98ab7ab9e8
commit fe967a2272
Signed by: edward
GPG key ID: 19182661E818369F

View file

@ -197,8 +197,8 @@ fn validate_token(
let (nonce, encrypted) = data.split_at(NONCEBYTES);
let nonce = Nonce::from_slice(&nonce).ok_or(TokenValidationError::InvalidNonce)?;
let decrypted = open_precomputed(&encrypted, &nonce, precomputed_key)
let nonce = Nonce::from_slice(nonce).ok_or(TokenValidationError::InvalidNonce)?;
let decrypted = open_precomputed(encrypted, &nonce, precomputed_key)
.map_err(|_| TokenValidationError::DecryptionFailure)?;
let parsed_token: Token =