* Fix: Changed clone url to public, so everyone -not only developers- can
clone.
* Fix: Changed $ stenc -f /dev/nst0 --detail to $ stenc -f /dev/nst0.
"--detail" is an unknown option in the newer versions.
* Add SPDX License information
Adding license information according to the SPDX stanard.
Used the reuse tool.
Bug: https://github.com/scsitape/stenc/issues/95
* Add SPDX license information to remaining files
- converted AUTHORS to markdown
- added FSFUL license INSTALL.license as it is named in the header of INSTALL
- added SPDX license information for some files such as insignificant-files
and uncopyrightable files.
used GPL-2-or-later where possible, because this was the former
statement of the project and in order to minimize the number of licenses
used.
See also https://reuse.software/faq/#uncopyrightable
and https://reuse.software/tutorial/#insignificant-files
- Replace `HEX` macro with inline function
- Replace `atoi` with `strtoul` and validate range of algorithm index
- Add back debug logging of SCSI traffic that got deleted a while ago
* Remove logging "additional sense bytes" since it was interpreting
the sense data wrong. Still print out the whole sense result in
debug mode.
- Fix some compiler warnings
* replace switch statement with if-else blocks since we don't use
all the enum values
* Validate options against device capabilities
* Use std::reference_wrapper instead of raw pointers
* Reword error message
* Also validate --(no-)allow-raw-read against device capabilities
* --ckod should do a media check
* Changes command line option processing:
- Use getopt_long in libc and support long options
- GNU style option processing (don't try to enforce non-conflicting options)
- GNU style usage message
- Separate encrypt and decrypt settings
- --unprotect -> --allow-raw-read, --protect -> --no-allow-raw-read for clarification
- Change reading key file from stdin using --key-file=-
- Always print detailed status, remove summary "Drive Encryption" line
* Other formatting and style cleanup
* Test output changes
The default CEEM (check external encryption mode) parameter is undocumented, and default of 0 makes behavior vendor-specific. The standard allows for a drive to report an error when trying to read a block that was pre-encrypted before written to the drive, such as is done with a keyless copy of a tape. This sounds like a very rare scenario to need to support. For the widest compatibility with data sources, this should be set to 1 for general-purpose use.
* pull updated template .clang-format with `clang-format-14 --style=llvm --dump-config`, move to base directory so it is shared between `src` and `tests`
* tweak to match existing style a little (e.g. K&R style for function braces)
* run on all sources
* Do media check before getting NBES and allow getting status without media
* Supress error from BLANK CHECK sense when querying next block encryption status
scsi::get_des & others should take a non-const buffer since they modify it
Reorder functions in main.cpp to declare internal functions static
Fix compile error in newer GCC (Compilation error #72) with more explicit cast
Remove some unused constants
Add KAD type enum
Pass key vector by reference instead of copying
Closes: https://github.com/scsitape/stenc/issues/72
* Introduce portable, endian-clean structures using shifts and masks instead of bitfields
* Modernize SCSIExecute with RAII and exceptions
* Convert SP-IN calls to use the new portable SCSI structures and functions
* Convert SP-OUT code to use the new portable SCSI structures and functions
* Delete bitfield-based code and remove runtime endian check
Closes: https://github.com/scsitape/stenc/issues/63
- pass string arguments by reference
- replace macros with constexpr where possible
- move command strings out of global scope
- use standard library strerror instead of custom printer readIOError