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.
This commit is contained in:
@@ -34,7 +34,7 @@ TEST_CASE("Test key_from_hex_chars", "[output]")
|
||||
*/
|
||||
TEST_CASE("Test SCSI inquiry output", "[output]")
|
||||
{
|
||||
const uint8_t response[] {
|
||||
const std::uint8_t response[] {
|
||||
0x01, 0x80, 0x00, 0x02, 0x5b, 0x00, 0x00, 0x02, 0x41, 0x43, 0x4d, 0x45,
|
||||
0x20, 0x20, 0x20, 0x20, 0x55, 0x6c, 0x74, 0x72, 0x69, 0x75, 0x6d, 0x2d,
|
||||
0x31, 0x30, 0x30, 0x30, 0x20, 0x20, 0x20, 0x20, 0x31, 0x32, 0x33, 0x34,
|
||||
@@ -57,7 +57,7 @@ Product Revision: 1234\n"s};
|
||||
|
||||
TEST_CASE("SCSI get device encryption status output 1", "[output]")
|
||||
{
|
||||
const uint8_t page[] {
|
||||
const std::uint8_t page[] {
|
||||
0x00, 0x20, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
};
|
||||
@@ -74,7 +74,7 @@ Key Instance Counter: 0\n"s};
|
||||
|
||||
TEST_CASE("SCSI get device encryption status output 2", "[output]")
|
||||
{
|
||||
const uint8_t page[] {
|
||||
const std::uint8_t page[] {
|
||||
0x00, 0x20, 0x00, 0x24, 0x42, 0x02, 0x02, 0x01, 0x00, 0x00,
|
||||
0x00, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x48, 0x65,
|
||||
@@ -95,7 +95,7 @@ Drive Key Desc.(uKAD): Hello world!\n"s};
|
||||
|
||||
TEST_CASE("Test SCSI get next block encryption status output 1", "[output]")
|
||||
{
|
||||
const uint8_t page[] {
|
||||
const std::uint8_t page[] {
|
||||
0x00, 0x21, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
|
||||
};
|
||||
@@ -108,7 +108,7 @@ Volume Encryption: Not encrypted\n"s};
|
||||
|
||||
TEST_CASE("Test SCSI get next block encryption status output 2", "[output]")
|
||||
{
|
||||
const uint8_t page[] {
|
||||
const std::uint8_t page[] {
|
||||
0x00, 0x21, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0c, 0x48, 0x65,
|
||||
0x6c, 0x6c, 0x6f, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x21,
|
||||
|
||||
@@ -22,7 +22,7 @@ TEST_CASE("Disable encryption command", "[scsi]")
|
||||
0x00, 0x10, // page code
|
||||
0x00, 0x10, // page length
|
||||
0x40, // scope
|
||||
DEFAULT_CEEM << 6, // CEEM, CKOD, RDMC, et al.
|
||||
0x40, // CEEM, CKOD, RDMC, et al.
|
||||
0x00, // encyption mode
|
||||
0x00, // decryption mode
|
||||
0x01, // algorithm index
|
||||
@@ -50,7 +50,7 @@ TEST_CASE("Enable encryption command", "[scsi]")
|
||||
0x00, 0x10, // page code
|
||||
0x00, 0x30, // page length
|
||||
0x40, // scope
|
||||
DEFAULT_CEEM << 6, // CEEM, CKOD, RDMC, et al.
|
||||
0x40, // CEEM, CKOD, RDMC, et al.
|
||||
0x02, // encyption mode
|
||||
0x02, // decryption mode
|
||||
0x01, // algorithm index
|
||||
@@ -86,7 +86,7 @@ TEST_CASE("Enable encryption command with options", "[scsi]")
|
||||
0x00, 0x10, // page code
|
||||
0x00, 0x30, // page length
|
||||
0x40, // scope
|
||||
DEFAULT_CEEM << 6 | 0x24, // CEEM, CKOD, RDMC, et al.
|
||||
0x64, // CEEM, CKOD, RDMC, et al.
|
||||
0x02, // encyption mode
|
||||
0x02, // decryption mode
|
||||
0x01, // algorithm index
|
||||
@@ -122,7 +122,7 @@ TEST_CASE("Enable encryption command with key name", "[scsi]")
|
||||
0x00, 0x10, // page code
|
||||
0x00, 0x40, // page length
|
||||
0x40, // scope
|
||||
DEFAULT_CEEM << 6, // CEEM, CKOD, RDMC, et al.
|
||||
0x40, // CEEM, CKOD, RDMC, et al.
|
||||
0x02, // encyption mode
|
||||
0x02, // decryption mode
|
||||
0x01, // algorithm index
|
||||
|
||||
Reference in New Issue
Block a user