Delete some unnecessary implicit conversions in pkcs12_test.cc
Noticed this as I was going over some code. C++17 CTAD means we don't
need to write the parameter, and arrays should implicitly convert to
spans anyway.
Change-Id: Ic5743fcbd8656fd2dba76e0cfcd7b061700d7c0b
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/75907
Reviewed-by: Bob Beck <bbe@google.com>
Commit-Queue: David Benjamin <davidben@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
diff --git a/crypto/pkcs8/pkcs12_test.cc b/crypto/pkcs8/pkcs12_test.cc
index 6f51682..e8d2c1b 100644
--- a/crypto/pkcs8/pkcs12_test.cc
+++ b/crypto/pkcs8/pkcs12_test.cc
@@ -396,67 +396,42 @@
}
TEST(PKCS12Test, RoundTrip) {
- TestRoundTrip(kPassword, nullptr /* no name */,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, 0, 0, 0, 0);
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, kTestCert,
+ {kTestCert2}, 0, 0, 0, 0);
// Test some Unicode.
- TestRoundTrip(kPassword, "Hello, 世界!",
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, 0, 0, 0, 0);
- TestRoundTrip(kUnicodePassword, nullptr /* no name */,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, 0, 0, 0, 0);
+ TestRoundTrip(kPassword, "Hello, 世界!", kTestKey, kTestCert, {kTestCert2}, 0,
+ 0, 0, 0);
+ TestRoundTrip(kUnicodePassword, nullptr /* no name */, kTestKey, kTestCert,
+ {kTestCert2}, 0, 0, 0, 0);
// Test various fields being missing.
- TestRoundTrip(kPassword, nullptr /* no name */, {} /* no key */,
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, 0, 0, 0, 0);
- TestRoundTrip(
- kPassword, nullptr /* no name */, bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert), {} /* no chain */, 0, 0, 0, 0);
- TestRoundTrip(kPassword, nullptr /* no name */,
- bssl::Span<const uint8_t>(kTestKey), {} /* no leaf */,
+ TestRoundTrip(kPassword, nullptr /* no name */, {} /* no key */, kTestCert,
+ {kTestCert2}, 0, 0, 0, 0);
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, kTestCert,
+ {} /* no chain */, 0, 0, 0, 0);
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, {} /* no leaf */,
{} /* no chain */, 0, 0, 0, 0);
// Test encryption parameters.
- TestRoundTrip(
- kPassword, nullptr /* no name */, bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, NID_pbe_WithSHA1And40BitRC2_CBC,
- NID_pbe_WithSHA1And40BitRC2_CBC, 100, 100);
- TestRoundTrip(
- kPassword, nullptr /* no name */, bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)}, NID_pbe_WithSHA1And128BitRC4,
- NID_pbe_WithSHA1And128BitRC4, 100, 100);
- TestRoundTrip(kPassword, nullptr /* no name */,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)},
- NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, kTestCert,
+ {kTestCert2}, NID_pbe_WithSHA1And40BitRC2_CBC,
+ NID_pbe_WithSHA1And40BitRC2_CBC, 100, 100);
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, kTestCert,
+ {kTestCert2}, NID_pbe_WithSHA1And128BitRC4,
+ NID_pbe_WithSHA1And128BitRC4, 100, 100);
+ TestRoundTrip(kPassword, nullptr /* no name */, kTestKey, kTestCert,
+ {kTestCert2}, NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
NID_pbe_WithSHA1And3_Key_TripleDES_CBC, 100, 100);
// Test unencrypted and partially unencrypted PKCS#12 files.
- TestRoundTrip(kPassword, /*name=*/nullptr,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)},
+ TestRoundTrip(kPassword, /*name=*/nullptr, kTestKey, kTestCert, {kTestCert2},
/*key_nid=*/-1,
/*cert_nid=*/-1, /*iterations=*/100, /*mac_iterations=*/100);
- TestRoundTrip(kPassword, /*name=*/nullptr,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)},
+ TestRoundTrip(kPassword, /*name=*/nullptr, kTestKey, kTestCert, {kTestCert2},
/*key_nid=*/NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
/*cert_nid=*/-1, /*iterations=*/100, /*mac_iterations=*/100);
- TestRoundTrip(kPassword, /*name=*/nullptr,
- bssl::Span<const uint8_t>(kTestKey),
- bssl::Span<const uint8_t>(kTestCert),
- {bssl::Span<const uint8_t>(kTestCert2)},
+ TestRoundTrip(kPassword, /*name=*/nullptr, kTestKey, kTestCert, {kTestCert2},
/*key_nid=*/-1,
/*cert_nid=*/NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
/*iterations=*/100, /*mac_iterations=*/100);