avoid lifetimes in blob reader/writer

This commit is contained in:
Wolfgang Bumiller
2019-08-16 09:19:01 +02:00
committed by Dietmar Maurer
parent 71d08e00b7
commit 9025312aa6
10 changed files with 98 additions and 79 deletions

View File

@ -1,4 +1,5 @@
use failure::*;
use std::sync::Arc;
use std::io::Write;
use super::CryptConfig;
@ -13,7 +14,7 @@ pub struct CryptWriter<W> {
impl <W: Write> CryptWriter<W> {
pub fn new(writer: W, config: &CryptConfig) -> Result<Self, Error> {
pub fn new(writer: W, config: Arc<CryptConfig>) -> Result<Self, Error> {
let mut iv = [0u8; 16];
proxmox::sys::linux::fill_with_random_data(&mut iv)?;
let block_size = config.cipher().block_size();