mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-19 09:00:54 +00:00
Merge pull request #864 from tunnell/fix/root-keys-fpga-key-ct-eq
Use constant-time compare for FPGA key check
This commit is contained in:
commit
679b709d2c
1 changed files with 2 additions and 1 deletions
|
|
@ -8,6 +8,7 @@ use core::num::NonZeroUsize;
|
||||||
|
|
||||||
use aes::Aes256;
|
use aes::Aes256;
|
||||||
use aes::cipher::{BlockDecrypt, BlockEncrypt};
|
use aes::cipher::{BlockDecrypt, BlockEncrypt};
|
||||||
|
use subtle::ConstantTimeEq;
|
||||||
use cipher::generic_array::GenericArray;
|
use cipher::generic_array::GenericArray;
|
||||||
use curve25519_dalek::scalar::Scalar;
|
use curve25519_dalek::scalar::Scalar;
|
||||||
use curve25519_dalek::{EdwardsPoint, edwards::CompressedEdwardsY};
|
use curve25519_dalek::{EdwardsPoint, edwards::CompressedEdwardsY};
|
||||||
|
|
@ -1642,7 +1643,7 @@ impl<'a> RootKeys {
|
||||||
{
|
{
|
||||||
Ok(verify) => {
|
Ok(verify) => {
|
||||||
log::debug!("got bip39 verification: {:x?}", verify);
|
log::debug!("got bip39 verification: {:x?}", verify);
|
||||||
if &verify == &pcache.fpga_key {
|
if bool::from(verify.as_slice().ct_eq(&pcache.fpga_key)) {
|
||||||
log::debug!("verify succeeded");
|
log::debug!("verify succeeded");
|
||||||
modals
|
modals
|
||||||
.show_notification(
|
.show_notification(
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue