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

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

Issue 8296014: Use NSS to generate Origin-Bound Certs on Win and Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review changes 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 unified diff | Download patch | Annotate | Revision Log
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 "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/pickle.h" 9 #include "base/pickle.h"
10 #include "base/sha1.h" 10 #include "base/sha1.h"
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 DCHECK(cert_handle) << "Failed to create self-signed certificate: " 623 DCHECK(cert_handle) << "Failed to create self-signed certificate: "
624 << GetLastError(); 624 << GetLastError();
625 if (!cert_handle) 625 if (!cert_handle)
626 return NULL; 626 return NULL;
627 627
628 X509Certificate* cert = CreateFromHandle(cert_handle, OSCertHandles()); 628 X509Certificate* cert = CreateFromHandle(cert_handle, OSCertHandles());
629 FreeOSCertHandle(cert_handle); 629 FreeOSCertHandle(cert_handle);
630 return cert; 630 return cert;
631 } 631 }
632 632
633 // static
634 X509Certificate* X509Certificate::CreateOriginBound(
635 crypto::RSAPrivateKey* key,
636 const std::string& origin,
637 uint32 serial_number,
638 base::TimeDelta valid_duration) {
639 NOTIMPLEMENTED();
640 return NULL;
641 }
642
643 void X509Certificate::GetSubjectAltName( 633 void X509Certificate::GetSubjectAltName(
644 std::vector<std::string>* dns_names, 634 std::vector<std::string>* dns_names,
645 std::vector<std::string>* ip_addrs) const { 635 std::vector<std::string>* ip_addrs) const {
646 if (dns_names) 636 if (dns_names)
647 dns_names->clear(); 637 dns_names->clear();
648 if (ip_addrs) 638 if (ip_addrs)
649 ip_addrs->clear(); 639 ip_addrs->clear();
650 640
651 if (!cert_handle_) 641 if (!cert_handle_)
652 return; 642 return;
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1061 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0], 1051 if (!CertSerializeCertificateStoreElement(cert_handle, 0, &buffer[0],
1062 &length)) { 1052 &length)) {
1063 return false; 1053 return false;
1064 } 1054 }
1065 1055
1066 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]), 1056 return pickle->WriteData(reinterpret_cast<const char*>(&buffer[0]),
1067 length); 1057 length);
1068 } 1058 }
1069 1059
1070 } // namespace net 1060 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698