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

Unified Diff: net/base/x509_certificate_mac.cc

Issue 8414047: Make X509Certificate::GetDEREncoded a static function taking an OSCertHandle (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and tweak comment to wtc's verbiage Created 9 years, 2 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
« no previous file with comments | « net/base/x509_certificate.h ('k') | net/base/x509_certificate_nss.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/x509_certificate_mac.cc
diff --git a/net/base/x509_certificate_mac.cc b/net/base/x509_certificate_mac.cc
index 61dbbe206f3d7073d22435a2837604b49be8eb1e..44acddf78167f84f1a5b912954ccd172c5bf6d0f 100644
--- a/net/base/x509_certificate_mac.cc
+++ b/net/base/x509_certificate_mac.cc
@@ -957,15 +957,15 @@ int X509Certificate::VerifyInternal(const std::string& hostname,
return OK;
}
-bool X509Certificate::GetDEREncoded(std::string* encoded) {
- encoded->clear();
+// static
+bool X509Certificate::GetDEREncoded(X509Certificate::OSCertHandle cert_handle,
+ std::string* encoded) {
CSSM_DATA der_data;
- if (SecCertificateGetData(cert_handle_, &der_data) == noErr) {
- encoded->append(reinterpret_cast<char*>(der_data.Data),
- der_data.Length);
- return true;
- }
- return false;
+ if (SecCertificateGetData(cert_handle, &der_data) != noErr)
+ return false;
+ encoded->assign(reinterpret_cast<char*>(der_data.Data),
+ der_data.Length);
+ return true;
}
// static
« no previous file with comments | « net/base/x509_certificate.h ('k') | net/base/x509_certificate_nss.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698