OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef NET_SSL_OPENSSL_SSL_UTIL_H_ | 5 #ifndef NET_SSL_OPENSSL_SSL_UTIL_H_ |
6 #define NET_SSL_OPENSSL_SSL_UTIL_H_ | 6 #define NET_SSL_OPENSSL_SSL_UTIL_H_ |
7 | 7 |
8 #include "net/cert/x509_certificate.h" | |
8 #include "net/log/net_log.h" | 9 #include "net/log/net_log.h" |
10 #include "net/ssl/scoped_openssl_types.h" | |
9 | 11 |
10 namespace crypto { | 12 namespace crypto { |
11 class OpenSSLErrStackTracer; | 13 class OpenSSLErrStackTracer; |
12 } | 14 } |
13 | 15 |
14 namespace tracked_objects { | 16 namespace tracked_objects { |
15 class Location; | 17 class Location; |
16 } | 18 } |
17 | 19 |
18 namespace net { | 20 namespace net { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
60 int MapOpenSSLErrorWithDetails(int err, | 62 int MapOpenSSLErrorWithDetails(int err, |
61 const crypto::OpenSSLErrStackTracer& tracer, | 63 const crypto::OpenSSLErrStackTracer& tracer, |
62 OpenSSLErrorInfo* out_error_info); | 64 OpenSSLErrorInfo* out_error_info); |
63 | 65 |
64 // Creates NetLog callback for an OpenSSL error. | 66 // Creates NetLog callback for an OpenSSL error. |
65 NetLog::ParametersCallback CreateNetLogOpenSSLErrorCallback( | 67 NetLog::ParametersCallback CreateNetLogOpenSSLErrorCallback( |
66 int net_error, | 68 int net_error, |
67 int ssl_error, | 69 int ssl_error, |
68 const OpenSSLErrorInfo& error_info); | 70 const OpenSSLErrorInfo& error_info); |
69 | 71 |
72 void FreeX509Stack(STACK_OF(X509) * ptr); | |
73 void FreeX509NameStack(STACK_OF(X509_NAME) * ptr); | |
74 | |
75 using ScopedX509Name = crypto::ScopedOpenSSL<X509_NAME, X509_NAME_free>; | |
davidben
2015/12/14 23:56:50
Nit: For consistency with other scopers, lets call
ryanchung
2015/12/16 22:40:02
Done.
| |
76 using ScopedX509Stack = crypto::ScopedOpenSSL<STACK_OF(X509), FreeX509Stack>; | |
77 using ScopedX509NameStack = | |
78 crypto::ScopedOpenSSL<STACK_OF(X509_NAME), FreeX509NameStack>; | |
davidben
2015/12/14 23:56:50
I'd put these in net/ssl/scoped_openssl_types.h
ryanchung
2015/12/16 22:40:02
Done.
| |
79 | |
80 // Used for encoding the |connection_status| field of an SSLInfo object. | |
81 int EncodeSSLConnectionStatus(int cipher_suite, int compression, int version); | |
davidben
2015/12/14 23:56:50
This isn't really OpenSSL-specific. It'd go better
ryanchung
2015/12/16 22:40:02
Done. Dropped.
| |
82 | |
83 // Returns the net SSL version number (see ssl_connection_status_flags.h) for | |
84 // this SSL connection. | |
85 int GetNetSSLVersion(SSL* ssl); | |
davidben
2015/12/14 23:56:50
#include <openssl/ssl.h>
ryanchung
2015/12/16 22:40:02
Done.
| |
86 | |
87 ScopedX509 OSCertHandleToOpenSSL(X509Certificate::OSCertHandle os_handle); | |
88 | |
89 ScopedX509Stack OSCertHandlesToOpenSSL( | |
90 const X509Certificate::OSCertHandles& os_handles); | |
91 | |
70 } // namespace net | 92 } // namespace net |
71 | 93 |
72 #endif // NET_SSL_OPENSSL_SSL_UTIL_H_ | 94 #endif // NET_SSL_OPENSSL_SSL_UTIL_H_ |
OLD | NEW |