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/cert/x509_certificate.h" | 5 #include "net/cert/x509_certificate.h" |
6 | 6 |
7 #include <openssl/asn1.h> | 7 #include <openssl/asn1.h> |
8 #include <openssl/bytestring.h> | 8 #include <openssl/bytestring.h> |
9 #include <openssl/crypto.h> | 9 #include <openssl/crypto.h> |
10 #include <openssl/obj_mac.h> | 10 #include <openssl/obj_mac.h> |
11 #include <openssl/pem.h> | 11 #include <openssl/pem.h> |
12 #include <openssl/sha.h> | 12 #include <openssl/sha.h> |
13 #include <openssl/ssl.h> | 13 #include <openssl/ssl.h> |
14 #include <openssl/x509v3.h> | 14 #include <openssl/x509v3.h> |
15 | 15 |
16 #include "base/memory/singleton.h" | 16 #include "base/memory/singleton.h" |
17 #include "base/pickle.h" | 17 #include "base/pickle.h" |
18 #include "base/sha1.h" | 18 #include "base/sha1.h" |
19 #include "base/strings/string_number_conversions.h" | 19 #include "base/strings/string_number_conversions.h" |
20 #include "base/strings/string_piece.h" | 20 #include "base/strings/string_piece.h" |
21 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
22 #include "crypto/openssl_util.h" | 22 #include "crypto/openssl_util.h" |
23 #include "crypto/scoped_openssl_types.h" | 23 #include "crypto/scoped_openssl_types.h" |
| 24 #include "net/base/ip_address_number.h" |
24 #include "net/base/net_errors.h" | 25 #include "net/base/net_errors.h" |
25 #include "net/base/net_util.h" | |
26 #include "net/cert/x509_util_openssl.h" | 26 #include "net/cert/x509_util_openssl.h" |
27 | 27 |
28 #if defined(OS_ANDROID) | 28 #if defined(OS_ANDROID) |
29 #include "base/logging.h" | 29 #include "base/logging.h" |
30 #include "net/android/network_library.h" | 30 #include "net/android/network_library.h" |
31 #endif | 31 #endif |
32 | 32 |
33 namespace net { | 33 namespace net { |
34 | 34 |
35 namespace { | 35 namespace { |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
453 bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) { | 453 bool X509Certificate::IsSelfSigned(OSCertHandle cert_handle) { |
454 crypto::ScopedEVP_PKEY scoped_key(X509_get_pubkey(cert_handle)); | 454 crypto::ScopedEVP_PKEY scoped_key(X509_get_pubkey(cert_handle)); |
455 if (!scoped_key) | 455 if (!scoped_key) |
456 return false; | 456 return false; |
457 | 457 |
458 // NOTE: X509_verify() returns 1 in case of success, 0 or -1 on error. | 458 // NOTE: X509_verify() returns 1 in case of success, 0 or -1 on error. |
459 return X509_verify(cert_handle, scoped_key.get()) == 1; | 459 return X509_verify(cert_handle, scoped_key.get()) == 1; |
460 } | 460 } |
461 | 461 |
462 } // namespace net | 462 } // namespace net |
OLD | NEW |