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

Side by Side Diff: net/base/x509_certificate_mac.cc

Issue 7740034: Revert 98288 - Added CreateOriginBound method to x509_certificate.h. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/base/x509_certificate.h ('k') | net/base/x509_certificate_nss.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/base/x509_certificate.h" 5 #include "net/base/x509_certificate.h"
6 6
7 #include <CommonCrypto/CommonDigest.h> 7 #include <CommonCrypto/CommonDigest.h>
8 #include <CoreServices/CoreServices.h> 8 #include <CoreServices/CoreServices.h>
9 #include <Security/Security.h> 9 #include <Security/Security.h>
10 #include <time.h> 10 #include <time.h>
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
688 encCert->CertEncoding, &certificate_ref); 688 encCert->CertEncoding, &certificate_ref);
689 if (os_status != 0) { 689 if (os_status != 0) {
690 DLOG(ERROR) << "SecCertificateCreateFromData failed: " << os_status; 690 DLOG(ERROR) << "SecCertificateCreateFromData failed: " << os_status;
691 return NULL; 691 return NULL;
692 } 692 }
693 scoped_cert.reset(certificate_ref); 693 scoped_cert.reset(certificate_ref);
694 694
695 return CreateFromHandle(scoped_cert, X509Certificate::OSCertHandles()); 695 return CreateFromHandle(scoped_cert, X509Certificate::OSCertHandles());
696 } 696 }
697 697
698 // static
699 X509Certificate* X509Certificate::CreateOriginBound(
700 crypto::RSAPrivateKey* key,
701 const std::string& origin,
702 uint32 serial_number,
703 base::TimeDelta valid_duration) {
704 // TODO(wtc): this cannot be implemented by creating a CE_DataAndType for
705 // the origin-bound extension and adding it to certReq.extensions because
706 // it is not one of the supported extensions in the CE_DataType enum type.
707 // Using the DT_Other enum constant does not work.
708 //
709 // The relevant Apple headers are:
710 // - CSSM_APPLE_TP_CERT_REQUEST is defined in cssmapple.h.
711 // - CE_DataAndType, CE_DataType, and CE_Data are defined in
712 // certextensions.h.
713 NOTIMPLEMENTED();
714 return NULL;
715 }
716
717 void X509Certificate::GetSubjectAltName( 698 void X509Certificate::GetSubjectAltName(
718 std::vector<std::string>* dns_names, 699 std::vector<std::string>* dns_names,
719 std::vector<std::string>* ip_addrs) const { 700 std::vector<std::string>* ip_addrs) const {
720 if (dns_names) 701 if (dns_names)
721 dns_names->clear(); 702 dns_names->clear();
722 if (ip_addrs) 703 if (ip_addrs)
723 ip_addrs->clear(); 704 ip_addrs->clear();
724 705
725 CSSMFields fields; 706 CSSMFields fields;
726 OSStatus status = GetCertFields(cert_handle_, &fields); 707 OSStatus status = GetCertFields(cert_handle_, &fields);
(...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 CSSM_DATA cert_data; 1338 CSSM_DATA cert_data;
1358 OSStatus status = SecCertificateGetData(cert_handle, &cert_data); 1339 OSStatus status = SecCertificateGetData(cert_handle, &cert_data);
1359 if (status) 1340 if (status)
1360 return false; 1341 return false;
1361 1342
1362 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data), 1343 return pickle->WriteData(reinterpret_cast<char*>(cert_data.Data),
1363 cert_data.Length); 1344 cert_data.Length);
1364 } 1345 }
1365 1346
1366 } // namespace net 1347 } // namespace net
OLDNEW
« 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