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

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

Issue 5746003: Defines SSLServerSocket and implements SSLServerSocketNSS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: convert cert and key Created 10 years 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_mac.cc ('k') | net/base/x509_certificate_openssl.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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <cert.h> 7 #include <cert.h>
8 #include <cryptohi.h> 8 #include <cryptohi.h>
9 #include <keyhi.h> 9 #include <keyhi.h>
10 #include <nss.h> 10 #include <nss.h>
(...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after
822 SECOidTag ev_policy_tag = SEC_OID_UNKNOWN; 822 SECOidTag ev_policy_tag = SEC_OID_UNKNOWN;
823 if (!metadata->GetPolicyOID(fingerprint, &ev_policy_tag)) 823 if (!metadata->GetPolicyOID(fingerprint, &ev_policy_tag))
824 return false; 824 return false;
825 825
826 if (!CheckCertPolicies(cert_handle_, ev_policy_tag)) 826 if (!CheckCertPolicies(cert_handle_, ev_policy_tag))
827 return false; 827 return false;
828 828
829 return true; 829 return true;
830 } 830 }
831 831
832 bool X509Certificate::GetDEREncoded(std::string* encoded) {
833 if (!cert_handle_->derCert.len)
834 return false;
835 encoded->clear();
836 encoded->append(reinterpret_cast<char*>(cert_handle_->derCert.data),
837 cert_handle_->derCert.len);
838 return true;
839 }
840
832 // static 841 // static
833 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a, 842 bool X509Certificate::IsSameOSCert(X509Certificate::OSCertHandle a,
834 X509Certificate::OSCertHandle b) { 843 X509Certificate::OSCertHandle b) {
835 DCHECK(a && b); 844 DCHECK(a && b);
836 if (a == b) 845 if (a == b)
837 return true; 846 return true;
838 return a->derCert.len == b->derCert.len && 847 return a->derCert.len == b->derCert.len &&
839 memcmp(a->derCert.data, b->derCert.data, a->derCert.len) == 0; 848 memcmp(a->derCert.data, b->derCert.data, a->derCert.len) == 0;
840 } 849 }
841 850
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
918 DCHECK(0 != cert->derCert.len); 927 DCHECK(0 != cert->derCert.len);
919 928
920 SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, sha1.data, 929 SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, sha1.data,
921 cert->derCert.data, cert->derCert.len); 930 cert->derCert.data, cert->derCert.len);
922 DCHECK(rv == SECSuccess); 931 DCHECK(rv == SECSuccess);
923 932
924 return sha1; 933 return sha1;
925 } 934 }
926 935
927 } // namespace net 936 } // namespace net
OLDNEW
« no previous file with comments | « net/base/x509_certificate_mac.cc ('k') | net/base/x509_certificate_openssl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698