scsitape / stenc

SCSI Tape Encryption Manager - stenc (formerly on https://sourceforge.net/projects/stenc/)
GNU General Public License v2.0
70 stars 16 forks source link

Print algorithm information in detail output #75

Closed jmwilson closed 2 years ago

jmwilson commented 2 years ago

One thing that makes stenc difficult for first use is knowing what to use for -a flag. This improves usability by printing the available algorithm indexes and some info about the cipher.

In the future, algorithm info can also be used to validate commands to the program. If someone sets options the drive doesn't support, they will get a illegal request status with some cryptic sense code data. Instead, stenc can query the algorithm info at the beginning and report a readable error before getting device errors.

Status for /dev/nst0
--------------------------------------------------
Vendor:                  HP
Product ID:              Ultrium 6-SCSI
Product Revision:        35PW
Drive Encryption:        off
Drive Output:            Not decrypting
                         Raw encrypted data not outputted
Drive Input:             Not encrypting
Key Instance Counter:    0
Supported algorithms:
1    AES-256-GCM-128
     Key descriptors allowed, maximum 32 bytes
     Raw decryption mode allowed, raw read enabled by default