118 Commits

Author SHA1 Message Date
Jonas Stein
704b5dd7dd Version bump to 2.0.1 2.0.1 2025-07-24 01:32:28 +02:00
Jonas Stein
1bb64e6408 Fix typo in configure
Superflous ] dropped
2025-07-24 00:47:42 +02:00
Jonas Stein
9a68c885f8 add thanks 2023-05-14 16:27:07 +02:00
Jonas Stein
3ed40cb71d ChangeLog for 2.0.0 2023-05-14 16:19:47 +02:00
Jonas Stein
4b0b7e1575 convert CRLF to LF 2.0.0 stenc-2.0.0_rc3 2023-05-14 14:29:27 +02:00
Jonas Stein
b853fd604a add version 2.0.0 2023-05-14 14:28:08 +02:00
James Wilson
7943f1860e Update license headers (#112) 2023-05-14 09:02:36 +02:00
James Wilson
57591d01a9 clang-format and include-what-you-use run (#111) stenc-2.0.0_rc2 2023-05-02 06:57:47 +02:00
James Wilson
daa541a654 Update status output format (#108)
* Update format of status output

* Add print_buffer and modernize SCSI debug output using std::for_each
2.0.0_rc
2023-05-01 22:48:54 +02:00
James Wilson
7e449bff7b missing verb in man page (#107) 2023-05-01 20:30:19 +02:00
James Wilson
22e21715f2 Remove unneeded STDC header check, reference https://www.gnu.org/software/autoconf/manual/autoconf-2.70/html_node/Default-Includes.html (#106)
remove DEFAULT_ALGORITHM config parameter
2023-05-01 19:32:07 +02:00
Jonas Stein
0e53223fc5 Add .license for CPE xml file 2023-01-17 23:06:06 +01:00
Jonas Stein
9d7b1ed4b8 Drop LGTM Badge 2023-01-17 23:04:50 +01:00
Alvaro Muñoz
965bba59bf Add CodeQL workflow (#103) 2023-01-17 23:01:09 +01:00
Christian Reiss
bfb35cd968 Remove --detail and change repository to https
* 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.
2022-10-21 17:00:58 +02:00
Jonas Stein
c979a3da74 add stenc.xml CPE file 2022-10-18 00:46:29 +02:00
Paweł Marciniak
eb012d9538 Pre-release 2.x.x spec file update (#99)
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-08-27 21:05:15 +02:00
Jonas Stein
31d63481d5 Add remaining SPDX License information (#97)
* 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
2022-08-25 23:59:52 +02:00
Jonas Stein
8b1756eb89 Add SPDX License information (#96)
Adding license information according to the SPDX stanard.
Used the reuse tool.
Bug: https://github.com/scsitape/stenc/issues/95
2022-08-24 22:41:43 +02:00
Paweł Marciniak
89d354e927 Add #include <limits> (#93)
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-06-26 17:16:45 +02:00
James Wilson
5366997e79 Minor housecleaning: (#91)
- 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
2022-06-21 07:58:54 +02:00
James Wilson
13af87abaa Fix FreeBSD build issues (#89) 2022-06-18 21:48:53 +02:00
James Wilson
918afb35fb Rewrite man page (#88) 2022-06-16 21:49:36 +02:00
James Wilson
f800dc2f51 Check ENCRYPT_C and DECRYPT_C fields in data encryption capabilities page (#85) 2022-06-06 02:42:59 +02:00
James Wilson
a3d03e5211 Use KAD format field (#86) 2022-06-06 00:40:52 +02:00
Jonas Stein
f77e46eeb0 bash completion in changelog 2022-06-05 16:42:10 +02:00
Paweł Marciniak
e6f7f1b7b3 Add bash completion (#84)
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-06-05 16:41:08 +02:00
James Wilson
b2082bf854 Do validation of options against device capabilities (#83)
* 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
2022-06-04 18:37:52 +02:00
James Wilson
23f8d829bf Change command line option processing (#82)
* 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
2022-06-01 00:05:46 +02:00
James Wilson
1200fe92ee Use hardcoded CEEM value instead of configure script parameter (#81)
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.
2022-05-28 11:50:08 +02:00
James Wilson
c6bf88e25f Add James Wilson to AUTHORS (#80) 2022-05-24 17:21:53 +02:00
Jonas Stein
aeab6f03de add author and reformat 2022-05-23 22:29:04 +02:00
James Wilson
490251f101 Fix incorrect radix printing (#78) 2022-05-19 09:08:51 +02:00
James Wilson
d2b7363769 clang-format run (#77)
* 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
2022-05-18 23:48:31 +02:00
James Wilson
86cca0804c Print algorithm information in detail output (#75)
* Print algorithm information in detail output
* Update documentation with information about algorithm listing
2022-05-18 22:28:37 +02:00
James Wilson
a7a7c4750c Do media checks on getting next block encryption status (#74)
* Do media check before getting NBES and allow getting status without media
* Supress error from BLANK CHECK sense when querying next block encryption status
2022-05-18 22:27:11 +02:00
James Wilson
8caaf85fbb Cleanup & reorganization (#73)
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
2022-05-16 02:05:14 +02:00
James Wilson
f5856d7591 Test for key_from_hex_chars (#70) 2022-05-13 23:17:53 +02:00
James Wilson
eeb7d72686 Introduce portable, endian-clean structures using shifts and masks instead of bitfields (#66)
* 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
2022-05-13 22:43:58 +02:00
James Wilson
1508f432ad Remove getuid root check (#68)
Closes: https://github.com/scsitape/stenc/discussions/64
2022-05-12 06:25:29 +02:00
Jonas Stein
08bd10230f add SCSI-Programming-HOWTO 2022-05-12 00:50:15 +02:00
James Wilson
13cf62cf8b Add unit test coverage of stenc output (#67)
using stream in functions instead of directly writing to cout
2022-05-12 00:40:39 +02:00
James Wilson
8ebccddc50 Small cleanup: (#65)
- 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
2022-05-10 19:20:55 +02:00
Paweł Marciniak
ebabc39c3e Fix missing manpage header (#62)
Closes: https://github.com/scsitape/stenc/issues/58
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-05-10 00:42:39 +02:00
James Wilson
88975cc9ed Use CAM and the pass(4) device instead of the optional sg(4) device on FreeBSD (#30) 2022-05-09 11:53:49 +02:00
Jonas Stein
8b7e99556a note on drop of AIX support 2022-05-09 11:48:57 +02:00
James Wilson
44603e4884 Remove key generation (#60)
Closes: https://github.com/scsitape/stenc/issues/3
Closes: https://github.com/scsitape/stenc/issues/32
2022-05-09 11:43:59 +02:00
Jonas Stein
859c1a0757 Update ChangeLog 2022-05-09 01:13:37 +02:00
James Wilson
e6ac5fa3f0 Remove AIX support (#59) 2022-05-09 01:11:07 +02:00
James Wilson
f893ee93cc Use standard syslog facilities for logging (#47)
Closes: https://github.com/scsitape/stenc/issues/31
Co-authored-by: Jonas Stein <news@jonasstein.de>
2022-05-09 01:00:18 +02:00