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

Unified Diff: net/cert/jwk_serializer_nss.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_nss.cc
diff --git a/net/cert/jwk_serializer_nss.cc b/net/cert/jwk_serializer_nss.cc
index 1db65f705ba2f93ded014c0ff2cbcf90e5d81eec..5ee6cd44a7383f0ba079c67ef2fbc8bc1be636f5 100644
--- a/net/cert/jwk_serializer_nss.cc
+++ b/net/cert/jwk_serializer_nss.cc
@@ -33,53 +33,47 @@ bool ConvertEcPrime256v1PublicKeyInfoToJwk(
public_key_jwk->SetString("kty", "EC");
public_key_jwk->SetString("crv", "P-256");
- base::StringPiece x(
- reinterpret_cast<char*>(spki->subjectPublicKey.data + 1),
- kPrime256v1PublicKeyLength / 2);
+ base::StringPiece x(reinterpret_cast<char*>(spki->subjectPublicKey.data + 1),
+ kPrime256v1PublicKeyLength / 2);
std::string x_b64;
base::Base64Encode(x, &x_b64);
public_key_jwk->SetString("x", x_b64);
- base::StringPiece y(
- reinterpret_cast<char*>(spki->subjectPublicKey.data + 1 +
- kPrime256v1PublicKeyLength / 2),
- kPrime256v1PublicKeyLength / 2);
+ base::StringPiece y(reinterpret_cast<char*>(spki->subjectPublicKey.data + 1 +
+ kPrime256v1PublicKeyLength / 2),
+ kPrime256v1PublicKeyLength / 2);
std::string y_b64;
base::Base64Encode(y, &y_b64);
public_key_jwk->SetString("y", y_b64);
return true;
}
-bool ConvertEcPublicKeyInfoToJwk(
- CERTSubjectPublicKeyInfo* spki,
- base::DictionaryValue* public_key_jwk) {
+bool ConvertEcPublicKeyInfoToJwk(CERTSubjectPublicKeyInfo* spki,
+ base::DictionaryValue* public_key_jwk) {
// 1.2.840.10045.3.1.7
// (iso.member-body.us.ansi-x9-62.ellipticCurve.primeCurve.prime256v1)
// (This includes the DER-encoded type (OID) and length: parameters can be
// anything, so the DER type isn't implied, and NSS includes it.)
- static const unsigned char kPrime256v1[] = {
- 0x06, 0x08, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x03, 0x01, 0x07
- };
+ static const unsigned char kPrime256v1[] = {0x06, 0x08, 0x2a, 0x86, 0x48,
+ 0xce, 0x3d, 0x03, 0x01, 0x07};
if (spki->algorithm.parameters.len == sizeof(kPrime256v1) &&
- !memcmp(spki->algorithm.parameters.data, kPrime256v1,
- sizeof(kPrime256v1))) {
+ !memcmp(
+ spki->algorithm.parameters.data, kPrime256v1, sizeof(kPrime256v1))) {
return ConvertEcPrime256v1PublicKeyInfoToJwk(spki, public_key_jwk);
}
// TODO(juanlang): other curves
return false;
}
-typedef scoped_ptr<
- CERTSubjectPublicKeyInfo,
- crypto::NSSDestroyer<CERTSubjectPublicKeyInfo,
- SECKEY_DestroySubjectPublicKeyInfo> >
+typedef scoped_ptr<CERTSubjectPublicKeyInfo,
+ crypto::NSSDestroyer<CERTSubjectPublicKeyInfo,
+ SECKEY_DestroySubjectPublicKeyInfo> >
ScopedCERTSubjectPublicKeyInfo;
} // namespace
-bool ConvertSpkiFromDerToJwk(
- const base::StringPiece& spki_der,
- base::DictionaryValue* public_key_jwk) {
+bool ConvertSpkiFromDerToJwk(const base::StringPiece& spki_der,
+ base::DictionaryValue* public_key_jwk) {
public_key_jwk->Clear();
crypto::EnsureNSSInit();
@@ -100,12 +94,12 @@ bool ConvertSpkiFromDerToJwk(
// (iso.member-body.us.ansi-x9-62.id-ecPublicKey)
// (This omits the ASN.1 encoding of the type (OID) and length: the fact that
// this is an OID is already clear, and NSS omits it here.)
- static const unsigned char kIdEcPublicKey[] = {
- 0x2A, 0x86, 0x48, 0xCE, 0x3D, 0x02, 0x01
- };
+ static const unsigned char kIdEcPublicKey[] = {0x2A, 0x86, 0x48, 0xCE,
+ 0x3D, 0x02, 0x01};
bool rv = false;
if (spki->algorithm.algorithm.len == sizeof(kIdEcPublicKey) &&
- !memcmp(spki->algorithm.algorithm.data, kIdEcPublicKey,
+ !memcmp(spki->algorithm.algorithm.data,
+ kIdEcPublicKey,
sizeof(kIdEcPublicKey))) {
rv = ConvertEcPublicKeyInfoToJwk(spki.get(), public_key_jwk);
}

Powered by Google App Engine
This is Rietveld 408576698