| Index: net/cert/x509_certificate_nss.cc
|
| diff --git a/net/cert/x509_certificate_nss.cc b/net/cert/x509_certificate_nss.cc
|
| index 9e95413a22e311d8b93bdc2e04078945847083d5..20edf9dee7705420659184ea30f60aead9a232a4 100644
|
| --- a/net/cert/x509_certificate_nss.cc
|
| +++ b/net/cert/x509_certificate_nss.cc
|
| @@ -43,9 +43,8 @@ X509Certificate* X509Certificate::CreateFromBytesWithNickname(
|
| const char* data,
|
| int length,
|
| const char* nickname) {
|
| - OSCertHandle cert_handle = CreateOSCertHandleFromBytesWithNickname(data,
|
| - length,
|
| - nickname);
|
| + OSCertHandle cert_handle =
|
| + CreateOSCertHandleFromBytesWithNickname(data, length, nickname);
|
| if (!cert_handle)
|
| return NULL;
|
|
|
| @@ -67,10 +66,10 @@ std::string X509Certificate::GetDefaultNickname(CertType type) const {
|
| // Find the private key for this certificate and see if it has a
|
| // nickname. If there is a private key, and it has a nickname, then
|
| // return that nickname.
|
| - SECKEYPrivateKey* private_key = PK11_FindPrivateKeyFromCert(
|
| - cert_handle_->slot,
|
| - cert_handle_,
|
| - NULL); // wincx
|
| + SECKEYPrivateKey* private_key =
|
| + PK11_FindPrivateKeyFromCert(cert_handle_->slot,
|
| + cert_handle_,
|
| + NULL); // wincx
|
| if (private_key) {
|
| char* private_key_nickname = PK11_GetPrivateKeyNickname(private_key);
|
| if (private_key_nickname) {
|
| @@ -99,8 +98,8 @@ std::string X509Certificate::GetDefaultNickname(CertType type) const {
|
| }
|
| // TODO(gspencer): Internationalize this. It's wrong to assume English
|
| // here.
|
| - result = base::StringPrintf("%s's %s ID", subject_name.c_str(),
|
| - issuer_.GetDisplayName().c_str());
|
| + result = base::StringPrintf(
|
| + "%s's %s ID", subject_name.c_str(), issuer_.GetDisplayName().c_str());
|
| break;
|
| }
|
| case SERVER_CERT:
|
| @@ -130,9 +129,8 @@ bool X509Certificate::IsIssuedByEncoded(
|
| // Convert encoded issuers to scoped CERTName* list.
|
| std::vector<CERTName*> issuers;
|
| crypto::ScopedPLArenaPool arena(PORT_NewArena(DER_DEFAULT_CHUNKSIZE));
|
| - if (!x509_util::GetIssuersFromEncodedList(valid_issuers,
|
| - arena.get(),
|
| - &issuers)) {
|
| + if (!x509_util::GetIssuersFromEncodedList(
|
| + valid_issuers, arena.get(), &issuers)) {
|
| return false;
|
| }
|
| return x509_util::IsCertificateIssuedBy(cert_chain, issuers);
|
| @@ -155,21 +153,21 @@ bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
|
| if (a == b)
|
| return true;
|
| return a->derCert.len == b->derCert.len &&
|
| - memcmp(a->derCert.data, b->derCert.data, a->derCert.len) == 0;
|
| + memcmp(a->derCert.data, b->derCert.data, a->derCert.len) == 0;
|
| }
|
|
|
| // static
|
| X509Certificate::OSCertHandle X509Certificate::CreateOSCertHandleFromBytes(
|
| - const char* data, int length) {
|
| + const char* data,
|
| + int length) {
|
| return CreateOSCertHandleFromBytesWithNickname(data, length, NULL);
|
| }
|
|
|
| // static
|
| X509Certificate::OSCertHandle
|
| -X509Certificate::CreateOSCertHandleFromBytesWithNickname(
|
| - const char* data,
|
| - int length,
|
| - const char* nickname) {
|
| +X509Certificate::CreateOSCertHandleFromBytesWithNickname(const char* data,
|
| + int length,
|
| + const char* nickname) {
|
| if (length < 0)
|
| return NULL;
|
|
|
| @@ -180,13 +178,15 @@ X509Certificate::CreateOSCertHandleFromBytesWithNickname(
|
|
|
| SECItem der_cert;
|
| der_cert.data = reinterpret_cast<unsigned char*>(const_cast<char*>(data));
|
| - der_cert.len = length;
|
| + der_cert.len = length;
|
| der_cert.type = siDERCertBuffer;
|
|
|
| // Parse into a certificate structure.
|
| - return CERT_NewTempCertificate(CERT_GetDefaultCertDB(), &der_cert,
|
| + return CERT_NewTempCertificate(CERT_GetDefaultCertDB(),
|
| + &der_cert,
|
| const_cast<char*>(nickname),
|
| - PR_FALSE, PR_TRUE);
|
| + PR_FALSE,
|
| + PR_TRUE);
|
| }
|
|
|
| // static
|
| @@ -209,16 +209,15 @@ void X509Certificate::FreeOSCertHandle(OSCertHandle cert_handle) {
|
| }
|
|
|
| // static
|
| -SHA1HashValue X509Certificate::CalculateFingerprint(
|
| - OSCertHandle cert) {
|
| +SHA1HashValue X509Certificate::CalculateFingerprint(OSCertHandle cert) {
|
| SHA1HashValue sha1;
|
| memset(sha1.data, 0, sizeof(sha1.data));
|
|
|
| DCHECK(NULL != cert->derCert.data);
|
| DCHECK_NE(0U, cert->derCert.len);
|
|
|
| - SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, sha1.data,
|
| - cert->derCert.data, cert->derCert.len);
|
| + SECStatus rv = HASH_HashBuf(
|
| + HASH_AlgSHA1, sha1.data, cert->derCert.data, cert->derCert.len);
|
| DCHECK_EQ(SECSuccess, rv);
|
|
|
| return sha1;
|
| @@ -246,8 +245,8 @@ SHA1HashValue X509Certificate::CalculateCAFingerprint(
|
| }
|
|
|
| // static
|
| -X509Certificate::OSCertHandle
|
| -X509Certificate::ReadOSCertHandleFromPickle(PickleIterator* pickle_iter) {
|
| +X509Certificate::OSCertHandle X509Certificate::ReadOSCertHandleFromPickle(
|
| + PickleIterator* pickle_iter) {
|
| return x509_util::ReadOSCertHandleFromPickle(pickle_iter);
|
| }
|
|
|
|
|