From 2cd4e80d9cba48f845dba46c531acb7153285998 Mon Sep 17 00:00:00 2001 From: bunnie Date: Mon, 30 May 2022 03:08:41 +0800 Subject: [PATCH] bring PDDB to AES 0.8 compatibility --- services/pddb/src/backend/basis.rs | 2 +- services/pddb/src/backend/hw.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/pddb/src/backend/basis.rs b/services/pddb/src/backend/basis.rs index 930c21f55..866db9659 100644 --- a/services/pddb/src/backend/basis.rs +++ b/services/pddb/src/backend/basis.rs @@ -139,7 +139,7 @@ use std::convert::TryInto; use aes_gcm_siv::{Aes256GcmSiv, Key}; use aes_gcm_siv::aead::NewAead; use aes::Aes256; -use aes::cipher::{NewBlockCipher, generic_array::GenericArray}; +use aes::cipher::{KeyInit, generic_array::GenericArray}; use std::iter::IntoIterator; use std::collections::{BinaryHeap, HashMap, HashSet}; use std::io::{Result, Error, ErrorKind}; diff --git a/services/pddb/src/backend/hw.rs b/services/pddb/src/backend/hw.rs index 1224e310b..e8a76d8ff 100644 --- a/services/pddb/src/backend/hw.rs +++ b/services/pddb/src/backend/hw.rs @@ -4,7 +4,7 @@ use crate::*; use aes_gcm_siv::{Aes256GcmSiv, Nonce, Key, Tag}; use aes_gcm_siv::aead::{Aead, NewAead, Payload}; use aes::{Aes256, Block, BLOCK_SIZE}; -use aes::cipher::{BlockDecrypt, BlockEncrypt, NewBlockCipher, generic_array::GenericArray}; +use aes::cipher::{BlockDecrypt, BlockEncrypt, KeyInit, generic_array::GenericArray}; use root_keys::api::AesRootkeyType; use spinor::SPINOR_BULK_ERASE_SIZE; use subtle::ConstantTimeEq; @@ -1438,6 +1438,7 @@ impl PddbOs { /// The number of servers that can connect to the Spinor crate is strictly tracked, so we borrow a reference /// to the Spinor object allocated to the PDDB implementation for this operation. pub(crate) fn pddb_format(&mut self, fast: bool, progress: Option<&modals::Modals>) -> Result<()> { + use cipher::BlockDecrypt; if !self.rootkeys.is_initialized().unwrap() { return Err(Error::new(ErrorKind::Unsupported, "Root keys are not initialized; cannot format a PDDB without root keys!")); }