diff --git a/src/tape/drive/lto/sg_tape.rs b/src/tape/drive/lto/sg_tape.rs index a451bbe2..8e822924 100644 --- a/src/tape/drive/lto/sg_tape.rs +++ b/src/tape/drive/lto/sg_tape.rs @@ -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, }