]> git.proxmox.com Git - proxmox-backup.git/commitdiff
tape: clear encryption key after backup (for security reasons)
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 8 Apr 2021 08:37:49 +0000 (10:37 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 8 Apr 2021 08:37:49 +0000 (10:37 +0200)
src/tape/drive/lto/sg_tape.rs

index a451bbe2e3e1013635e34e9192058d5e0fcefbf0..8e822924cb91406cfcbc8b5c924a3dc30078b534 100644 (file)
@@ -661,6 +661,14 @@ impl SgTape {
     }
 }
 
+impl Drop for SgTape {
+    fn drop(&mut self) {
+        // For security reasons, clear the encryption key
+        let _ = self.set_encryption(None);
+    }
+}
+
+
 pub struct SgTapeReader<'a> {
     sg_tape: &'a mut SgTape,
 }