| OLD | NEW |
| 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 #ifndef NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ | 5 #ifndef NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ |
| 6 #define NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ | 6 #define NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 | 15 |
| 16 // SSLCipherSuiteToStrings returns three strings for a given cipher suite | 16 // SSLCipherSuiteToStrings returns three strings for a given cipher suite |
| 17 // number, the name of the key exchange algorithm, the name of the cipher and | 17 // number, the name of the key exchange algorithm, the name of the cipher and |
| 18 // the name of the MAC. The cipher suite number is the number as sent on the | 18 // the name of the MAC. The cipher suite number is the number as sent on the |
| 19 // wire and recorded at | 19 // wire and recorded at |
| 20 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml | 20 // http://www.iana.org/assignments/tls-parameters/tls-parameters.xml |
| 21 // If the cipher suite is unknown, the strings are set to "???". | 21 // If the cipher suite is unknown, the strings are set to "???". |
| 22 // In the case of an AEAD cipher suite, *mac_str is NULL and *is_aead is true. | 22 // In the case of an AEAD cipher suite, *mac_str is nullptr and *is_aead is |
| 23 // true. |
| 24 // In the case of a TLS 1.3 AEAD-only cipher suite, *key_exchange_str is nullptr |
| 25 // and *is_tls13 is true. |
| 23 NET_EXPORT void SSLCipherSuiteToStrings(const char** key_exchange_str, | 26 NET_EXPORT void SSLCipherSuiteToStrings(const char** key_exchange_str, |
| 24 const char** cipher_str, | 27 const char** cipher_str, |
| 25 const char** mac_str, | 28 const char** mac_str, |
| 26 bool* is_aead, | 29 bool* is_aead, |
| 30 bool* is_tls13, |
| 27 uint16_t cipher_suite); | 31 uint16_t cipher_suite); |
| 28 | 32 |
| 29 // SSLVersionToString returns the name of the SSL protocol version | 33 // SSLVersionToString returns the name of the SSL protocol version |
| 30 // specified by |ssl_version|, which is defined in | 34 // specified by |ssl_version|, which is defined in |
| 31 // net/ssl/ssl_connection_status_flags.h. | 35 // net/ssl/ssl_connection_status_flags.h. |
| 32 // If the version is unknown, |name| is set to "???". | 36 // If the version is unknown, |name| is set to "???". |
| 33 NET_EXPORT void SSLVersionToString(const char** name, int ssl_version); | 37 NET_EXPORT void SSLVersionToString(const char** name, int ssl_version); |
| 34 | 38 |
| 35 // Parses a string literal that represents a SSL/TLS cipher suite. | 39 // Parses a string literal that represents a SSL/TLS cipher suite. |
| 36 // | 40 // |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 // - Cipher: not an AEAD cipher | 73 // - Cipher: not an AEAD cipher |
| 70 NET_EXPORT int ObsoleteSSLStatus(int connection_status); | 74 NET_EXPORT int ObsoleteSSLStatus(int connection_status); |
| 71 | 75 |
| 72 // Returns true if |cipher_suite| is suitable for use with HTTP/2. See | 76 // Returns true if |cipher_suite| is suitable for use with HTTP/2. See |
| 73 // https://http2.github.io/http2-spec/#rfc.section.9.2.2. | 77 // https://http2.github.io/http2-spec/#rfc.section.9.2.2. |
| 74 NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite); | 78 NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite); |
| 75 | 79 |
| 76 } // namespace net | 80 } // namespace net |
| 77 | 81 |
| 78 #endif // NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ | 82 #endif // NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ |
| OLD | NEW |