| 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
|
|
|