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:
parent
6edceb5f7a
commit
1dae6093c9
3 changed files with 7 additions and 6 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue