]> git.proxmox.com Git - proxmox-backup.git/commitdiff
lto/sg_tape/encryption: remove non lto-4 supported byte
authorDominik Csapak <d.csapak@proxmox.com>
Mon, 31 May 2021 08:29:31 +0000 (10:29 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 31 May 2021 08:58:38 +0000 (10:58 +0200)
from the SspDataEncryptionCapabilityPage

it seems we do not need it, since the EXTDECC flag is only used for
determining if the drive is capable to be configured via
ADI (Automation/Drive Interface) which we do not use at all.

this makes the call work with LTO-4 again

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/tape/drive/lto/sg_tape/encryption.rs

index 7b687f2c35a789100fdc7dda76f18b9476472c8b..5ce571e4e754b9f08f662e6ecb85894cb8ddf405 100644 (file)
@@ -195,8 +195,7 @@ struct DataEncryptionStatus {
 struct SspDataEncryptionCapabilityPage {
     page_code: u16,
     page_len: u16,
-    extdecc_cfgp_byte: u8,
-    reserved: [u8; 15],
+    reserved: [u8; 16],
 }
 
 #[derive(Endian)]
@@ -222,17 +221,7 @@ fn decode_spin_data_encryption_caps(data: &[u8]) -> Result<u8, Error> {
 
     proxmox::try_block!({
         let mut reader = &data[..];
-        let page: SspDataEncryptionCapabilityPage = unsafe { reader.read_be_value()? };
-
-        let extdecc = (page.extdecc_cfgp_byte & 0b00001100) >> 2;
-        if extdecc != 2 {
-            bail!("not external data encryption control capable");
-        }
-
-        let cfg_p = page.extdecc_cfgp_byte & 0b00000011;
-        if cfg_p != 1 {
-            bail!("not allow to change logical block encryption parameters");
-        }
+        let _page: SspDataEncryptionCapabilityPage = unsafe { reader.read_be_value()? };
 
         let mut aes_cgm_index = None;