OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <openssl/asn1.h> | 7 #include <openssl/asn1.h> |
8 #include <openssl/crypto.h> | 8 #include <openssl/crypto.h> |
9 #include <openssl/obj_mac.h> | 9 #include <openssl/obj_mac.h> |
10 #include <openssl/pem.h> | 10 #include <openssl/pem.h> |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 643 |
644 return GetDERAndCacheIfNeeded(a, &der_cache_a) && | 644 return GetDERAndCacheIfNeeded(a, &der_cache_a) && |
645 GetDERAndCacheIfNeeded(b, &der_cache_b) && | 645 GetDERAndCacheIfNeeded(b, &der_cache_b) && |
646 der_cache_a.data_length == der_cache_b.data_length && | 646 der_cache_a.data_length == der_cache_b.data_length && |
647 memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0; | 647 memcmp(der_cache_a.data, der_cache_b.data, der_cache_a.data_length) == 0; |
648 } | 648 } |
649 | 649 |
650 // static | 650 // static |
651 X509Certificate::OSCertHandle | 651 X509Certificate::OSCertHandle |
652 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, | 652 X509Certificate::ReadOSCertHandleFromPickle(const Pickle& pickle, |
653 void** pickle_iter) { | 653 PickleIterator* pickle_iter) { |
654 const char* data; | 654 const char* data; |
655 int length; | 655 int length; |
656 if (!pickle.ReadData(pickle_iter, &data, &length)) | 656 if (!pickle.ReadData(pickle_iter, &data, &length)) |
657 return NULL; | 657 return NULL; |
658 | 658 |
659 return CreateOSCertHandleFromBytes(data, length); | 659 return CreateOSCertHandleFromBytes(data, length); |
660 } | 660 } |
661 | 661 |
662 // static | 662 // static |
663 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, | 663 bool X509Certificate::WriteOSCertHandleToPickle(OSCertHandle cert_handle, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 for (OSCertHandles::const_iterator it = cert_handles.begin(); | 717 for (OSCertHandles::const_iterator it = cert_handles.begin(); |
718 it != cert_handles.end(); ++it) { | 718 it != cert_handles.end(); ++it) { |
719 std::string cert_bytes; | 719 std::string cert_bytes; |
720 GetDEREncoded(*it, &cert_bytes); | 720 GetDEREncoded(*it, &cert_bytes); |
721 chain_bytes->push_back(cert_bytes); | 721 chain_bytes->push_back(cert_bytes); |
722 } | 722 } |
723 } | 723 } |
724 #endif | 724 #endif |
725 | 725 |
726 } // namespace net | 726 } // namespace net |
OLD | NEW |