summaryrefslogtreecommitdiffstats
path: root/chrome/common/net/x509_certificate_model_nss.cc
diff options
context:
space:
mode:
authorbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 12:59:54 +0000
committerbulach@chromium.org <bulach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-25 12:59:54 +0000
commit5c51876fc45efafe4b9d918553c7b32a854ed8ed (patch)
tree2acc3b2ef0b1f76005b3e081553e01c9e149fc30 /chrome/common/net/x509_certificate_model_nss.cc
parent4da06efd6d467e07ac311a59e5f79bd0cc6145d4 (diff)
downloadchromium_src-5c51876fc45efafe4b9d918553c7b32a854ed8ed.zip
chromium_src-5c51876fc45efafe4b9d918553c7b32a854ed8ed.tar.gz
chromium_src-5c51876fc45efafe4b9d918553c7b32a854ed8ed.tar.bz2
More UI-related OpenSSL support.
Refactors a few functions from nsNSSCertHelper into common. (no functional change when using NSS). Implements some of the x509_certificate_model functions for OpenSSL. BUG=none TEST=Compile w/ use_openssl=1, check that the fields in certificate viewer are displayed. Review URL: http://codereview.chromium.org/3815012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63723 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/net/x509_certificate_model_nss.cc')
-rw-r--r--chrome/common/net/x509_certificate_model_nss.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/chrome/common/net/x509_certificate_model_nss.cc b/chrome/common/net/x509_certificate_model_nss.cc
index da17a60..4d46174 100644
--- a/chrome/common/net/x509_certificate_model_nss.cc
+++ b/chrome/common/net/x509_certificate_model_nss.cc
@@ -42,7 +42,6 @@ std::string Stringize(char* nss_text, const std::string& alternative_text) {
// algorithm, but given the limited uses, not worth fixing.)
std::string HashCert(CERTCertificate* cert, HASH_HashType algorithm, int len) {
unsigned char fingerprint[HASH_LENGTH_MAX];
- SECItem fingerprint_item;
DCHECK(NULL != cert->derCert.data);
DCHECK_NE(0U, cert->derCert.len);
@@ -51,9 +50,7 @@ std::string HashCert(CERTCertificate* cert, HASH_HashType algorithm, int len) {
SECStatus rv = HASH_HashBuf(algorithm, fingerprint, cert->derCert.data,
cert->derCert.len);
DCHECK_EQ(rv, SECSuccess);
- fingerprint_item.data = fingerprint;
- fingerprint_item.len = len;
- return psm::ProcessRawBytes(&fingerprint_item);
+ return x509_certificate_model::ProcessRawBytes(fingerprint, len);
}
std::string ProcessSecAlgorithmInternal(SECAlgorithmID* algorithm_id) {
@@ -293,6 +290,7 @@ void DestroyCertChain(X509Certificate::OSCertHandles* cert_handles) {
for (X509Certificate::OSCertHandles::iterator i(cert_handles->begin());
i != cert_handles->end(); ++i)
CERT_DestroyCertificate(*i);
+ cert_handles->clear();
}
string GetDerString(X509Certificate::OSCertHandle cert_handle) {
@@ -372,7 +370,8 @@ string ProcessSubjectPublicKeyInfo(X509Certificate::OSCertHandle cert_handle) {
}
string ProcessRawBitsSignatureWrap(X509Certificate::OSCertHandle cert_handle) {
- return psm::ProcessRawBits(&cert_handle->signatureWrap.signature);
+ return ProcessRawBits(cert_handle->signatureWrap.signature.data,
+ cert_handle->signatureWrap.signature.len);
}
void RegisterDynamicOids() {