style fix
This commit is contained in:
@@ -31,8 +31,7 @@ use cbor::cbor_array_vec;
|
||||
use core::cmp;
|
||||
use core::convert::TryInto;
|
||||
use crypto::rng256::Rng256;
|
||||
use persistent_store::fragment::{read_range, write};
|
||||
use persistent_store::StoreUpdate;
|
||||
use persistent_store::{fragment, StoreUpdate};
|
||||
|
||||
// Those constants may be modified before compilation to tune the behavior of the key.
|
||||
//
|
||||
@@ -485,14 +484,14 @@ impl PersistentStore {
|
||||
byte_count: usize,
|
||||
) -> Result<Vec<u8>, Ctap2StatusCode> {
|
||||
let byte_range = offset..offset + byte_count;
|
||||
let output = read_range(&self.store, &key::LARGE_BLOB_SHARDS, byte_range)?;
|
||||
let output = fragment::read_range(&self.store, &key::LARGE_BLOB_SHARDS, byte_range)?;
|
||||
Ok(output.unwrap_or_else(|| {
|
||||
let empty_large_blob = vec![
|
||||
const EMPTY_LARGE_BLOB: [u8; 17] = [
|
||||
0x80, 0x76, 0xBE, 0x8B, 0x52, 0x8D, 0x00, 0x75, 0xF7, 0xAA, 0xE9, 0x8D, 0x6F, 0xA5,
|
||||
0x7A, 0x6D, 0x3C,
|
||||
];
|
||||
let last_index = cmp::min(empty_large_blob.len(), offset + byte_count);
|
||||
empty_large_blob
|
||||
let last_index = cmp::min(EMPTY_LARGE_BLOB.len(), offset + byte_count);
|
||||
EMPTY_LARGE_BLOB
|
||||
.get(offset..last_index)
|
||||
.unwrap_or_default()
|
||||
.to_vec()
|
||||
@@ -508,7 +507,7 @@ impl PersistentStore {
|
||||
if large_blob_array.len() > MAX_LARGE_BLOB_ARRAY_SIZE {
|
||||
return Err(Ctap2StatusCode::CTAP2_ERR_VENDOR_INTERNAL_ERROR);
|
||||
}
|
||||
Ok(write(
|
||||
Ok(fragment::write(
|
||||
&mut self.store,
|
||||
&key::LARGE_BLOB_SHARDS,
|
||||
large_blob_array,
|
||||
|
||||
Reference in New Issue
Block a user