1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-07-14 00:04:59 +00:00

Use subtle to replace deprecated ring::constant_time::verify_slices_are_equal (#5680)

This commit is contained in:
Timshel 2025-03-15 18:33:17 +00:00 committed by GitHub
parent 6edceb5f7a
commit 1dae6093c9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 6 deletions

View file

@ -110,7 +110,6 @@ pub fn generate_api_key() -> String {
// Constant time compare
//
pub fn ct_eq<T: AsRef<[u8]>, U: AsRef<[u8]>>(a: T, b: U) -> bool {
use ring::constant_time::verify_slices_are_equal;
verify_slices_are_equal(a.as_ref(), b.as_ref()).is_ok()
use subtle::ConstantTimeEq;
a.as_ref().ct_eq(b.as_ref()).into()
}