forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log the (server, to-be-verified) certificate chains to the NetLog whe…
…n logging bytes. BUG=91464 Review URL: http://codereview.chromium.org/8413072 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108615 0039d316-1c4b-4281-b951-d872f2087c98
- Loading branch information
rsleevi@chromium.org
committed
Nov 4, 2011
1 parent
9b15b2f
commit 5946838
Showing
12 changed files
with
176 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright (c) 2011 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "net/base/x509_certificate_net_log_param.h" | ||
|
||
#include "base/values.h" | ||
#include "net/base/x509_certificate.h" | ||
|
||
namespace net { | ||
|
||
X509CertificateNetLogParam::X509CertificateNetLogParam( | ||
X509Certificate* certificate) { | ||
certificate->GetPEMEncodedChain(&encoded_chain_); | ||
} | ||
|
||
X509CertificateNetLogParam::~X509CertificateNetLogParam() {} | ||
|
||
base::Value* X509CertificateNetLogParam::ToValue() const { | ||
DictionaryValue* dict = new DictionaryValue(); | ||
ListValue* certs = new ListValue(); | ||
for (size_t i = 0; i < encoded_chain_.size(); ++i) | ||
certs->Append(base::Value::CreateStringValue(encoded_chain_[i])); | ||
dict->Set("certificates", certs); | ||
return dict; | ||
} | ||
|
||
} // namespace net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright (c) 2011 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#ifndef NET_BASE_X509_CERT_NET_LOG_PARAM_H_ | ||
#define NET_BASE_X509_CERT_NET_LOG_PARAM_H_ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "base/compiler_specific.h" | ||
#include "net/base/net_log.h" | ||
|
||
namespace net { | ||
|
||
class X509Certificate; | ||
|
||
// NetLog parameter to describe an X509Certificate. | ||
// Note: These parameters are memory intensive, due to PEM-encoding each | ||
// certificate, thus should only be used when logging at NetLog::LOG_ALL. | ||
class X509CertificateNetLogParam : public NetLog::EventParameters { | ||
public: | ||
explicit X509CertificateNetLogParam(X509Certificate* certificate); | ||
virtual ~X509CertificateNetLogParam(); | ||
|
||
virtual base::Value* ToValue() const OVERRIDE; | ||
|
||
private: | ||
std::vector<std::string> encoded_chain_; | ||
}; | ||
|
||
} // namespace net | ||
|
||
#endif // NET_BASE_X509_CERT_NET_LOG_PARAM_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters