Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Unified Diff: net/cert/jwk_serializer_unittest.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/cert/jwk_serializer_unittest.cc
diff --git a/net/cert/jwk_serializer_unittest.cc b/net/cert/jwk_serializer_unittest.cc
index dbf0e97689c9366b6853905c769b2d129afeb1d1..697d7a9074f68a6eaaf32e6e8907465b48a4e046 100644
--- a/net/cert/jwk_serializer_unittest.cc
+++ b/net/cert/jwk_serializer_unittest.cc
@@ -22,46 +22,34 @@ namespace net {
// public key. Following that are the two field elements as 32-byte,
// big-endian numbers, as required by the Channel ID.
static const unsigned char kP256SpkiPrefix[] = {
- 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
- 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
- 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
- 0x42, 0x00, 0x04
-};
+ 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48,
+ 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48,
+ 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03, 0x42, 0x00, 0x04};
static const unsigned int kEcCoordinateSize = 32U;
#endif
// This is a valid P-256 public key.
static const unsigned char kSpkiEc[] = {
- 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
- 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
- 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
- 0x42, 0x00, 0x04,
- 0x29, 0x5d, 0x6e, 0xfe, 0x33, 0x77, 0x26, 0xea,
- 0x5b, 0xa4, 0xe6, 0x1b, 0x34, 0x6e, 0x7b, 0xa0,
- 0xa3, 0x8f, 0x33, 0x49, 0xa0, 0x9c, 0xae, 0x98,
- 0xbd, 0x46, 0x0d, 0xf6, 0xd4, 0x5a, 0xdc, 0x8a,
- 0x1f, 0x8a, 0xb2, 0x20, 0x51, 0xb7, 0xd2, 0x87,
- 0x0d, 0x53, 0x7e, 0x5d, 0x94, 0xa3, 0xe0, 0x34,
- 0x16, 0xa1, 0xcc, 0x10, 0x48, 0xcd, 0x70, 0x9c,
- 0x05, 0xd3, 0xd2, 0xca, 0xdf, 0x44, 0x2f, 0xf4
-};
+ 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
+ 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
+ 0x42, 0x00, 0x04, 0x29, 0x5d, 0x6e, 0xfe, 0x33, 0x77, 0x26, 0xea, 0x5b,
+ 0xa4, 0xe6, 0x1b, 0x34, 0x6e, 0x7b, 0xa0, 0xa3, 0x8f, 0x33, 0x49, 0xa0,
+ 0x9c, 0xae, 0x98, 0xbd, 0x46, 0x0d, 0xf6, 0xd4, 0x5a, 0xdc, 0x8a, 0x1f,
+ 0x8a, 0xb2, 0x20, 0x51, 0xb7, 0xd2, 0x87, 0x0d, 0x53, 0x7e, 0x5d, 0x94,
+ 0xa3, 0xe0, 0x34, 0x16, 0xa1, 0xcc, 0x10, 0x48, 0xcd, 0x70, 0x9c, 0x05,
+ 0xd3, 0xd2, 0xca, 0xdf, 0x44, 0x2f, 0xf4};
#if !defined(USE_OPENSSL)
// This is a P-256 public key with 0 X and Y values.
static const unsigned char kSpkiEcWithZeroXY[] = {
- 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86,
- 0x48, 0xce, 0x3d, 0x02, 0x01, 0x06, 0x08, 0x2a,
- 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
- 0x42, 0x00, 0x04,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
+ 0x30, 0x59, 0x30, 0x13, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
+ 0x01, 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07, 0x03,
+ 0x42, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
TEST(JwkSerializerNSSTest, ConvertSpkiFromDerToJwkEc) {
base::StringPiece spki;
@@ -94,8 +82,8 @@ TEST(JwkSerializerNSSTest, ConvertSpkiFromDerToJwkEc) {
EXPECT_EQ(kEcCoordinateSize, decoded_coordinate.size());
EXPECT_EQ(0,
memcmp(decoded_coordinate.data(),
- kSpkiEc + sizeof(kP256SpkiPrefix) + kEcCoordinateSize,
- kEcCoordinateSize));
+ kSpkiEc + sizeof(kP256SpkiPrefix) + kEcCoordinateSize,
+ kEcCoordinateSize));
// Test the result of a corner case: leading 0s in the x, y coordinates are
// not trimmed, but the point is fixed-length encoded.
@@ -119,7 +107,8 @@ TEST(JwkSerializerNSSTest, ConvertSpkiFromDerToJwkEc) {
EXPECT_TRUE(public_key_jwk.GetString("y", &string_value));
EXPECT_TRUE(base::Base64Decode(string_value, &decoded_coordinate));
EXPECT_EQ(kEcCoordinateSize, decoded_coordinate.size());
- EXPECT_EQ(0,
+ EXPECT_EQ(
+ 0,
memcmp(decoded_coordinate.data(),
kSpkiEcWithZeroXY + sizeof(kP256SpkiPrefix) + kEcCoordinateSize,
kEcCoordinateSize));

Powered by Google App Engine
This is Rietveld 408576698