Commit Graph

19 Commits

Author SHA1 Message Date
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
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
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
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
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
James Wilson
fbba173a1f Remove device renaming and select default device (#48) 2022-05-09 00:52:07 +02:00
James Wilson
13f09ea5aa Remove KeyInfo and use standard library to parse hex strings (#46)
* Remove KeyInfo and use standard library to parse hex strings

* One declaration per line, more useful name of key_from_hex_chars
2022-05-08 21:07:58 +02:00
Paweł Marciniak
844306dbe4 cast to proper type (#38)
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-04-24 12:52:30 +02:00
Jonas Stein
8ff2e4c4eb Codecleanup, Version bump 1.1.0 2022-04-22 00:47:33 +02:00
Jonas Stein
35b852cfeb add .clang-cormat
Add .clang-cormat config file to src folder for unified formatting.
2022-04-20 01:00:40 +02:00
Jonas Stein
88a507932e reformat and cleanup more
reformat the source in an unified way.
(improve later with clang-format config)
fix order of includes
use proper delete[] operator
2022-04-20 00:24:59 +02:00
Jonas Stein
aa2244308d cleaned code
removed std namespace
initialized variables
cleaned endl
added const for constants
tagged new version 1.0.8
2022-04-20 00:12:52 +02:00
Paweł Marciniak
e1e3676660 Use /dev/random to create a key (#22)
Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2022-04-19 22:16:37 +02:00
sunwire
b650fb67c0 Update URL from sf to github (#21)
* Correct url from sf to github

Co-authored-by: Paweł Marciniak <sunwire+git@gmail.com>
2020-11-13 00:25:23 +01:00
Denys Berkovskyy
f4465cd21b Fix inclusion of standard headers on non-linux systems 2018-02-14 04:37:29 +01:00
John Coleman
3066499e09 Import stenc-1.0.7
https://sourceforge.net/projects/stenc/files/source/stenc-1.0.7.tar.gz/download
2018-02-14 04:13:34 +01:00
John Coleman
db613c9828 Import stenc-1.0.6
Import https://sourceforge.net/projects/stenc/files/source/stenc-1.0.6.tar.gz/download
2018-02-14 04:11:24 +01:00