| 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> |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 // true. | 23 // true. |
| 24 // In the case of a TLS 1.3 AEAD-only cipher suite, *key_exchange_str is nullptr | 24 // In the case of a TLS 1.3 AEAD-only cipher suite, *key_exchange_str is nullptr |
| 25 // and *is_tls13 is true. | 25 // and *is_tls13 is true. |
| 26 NET_EXPORT void SSLCipherSuiteToStrings(const char** key_exchange_str, | 26 NET_EXPORT void SSLCipherSuiteToStrings(const char** key_exchange_str, |
| 27 const char** cipher_str, | 27 const char** cipher_str, |
| 28 const char** mac_str, | 28 const char** mac_str, |
| 29 bool* is_aead, | 29 bool* is_aead, |
| 30 bool* is_tls13, | 30 bool* is_tls13, |
| 31 uint16_t cipher_suite); | 31 uint16_t cipher_suite); |
| 32 | 32 |
| 33 // SSLCipherSuiteToComposedString returns the name of the cipher suite |
| 34 // specified by |cipher_suite|. The name is in the format |
| 35 // 'TLS_{key-exchange}_WITH_{cipher}_{prf}' or 'TLS_{cipher}_{prf}' if |
| 36 // the cipher is AEAD. |
| 37 NET_EXPORT std::string SSLCipherSuiteToComposedString(uint16_t cipher_suite); |
| 38 |
| 33 // SSLVersionToString returns the name of the SSL protocol version | 39 // SSLVersionToString returns the name of the SSL protocol version |
| 34 // specified by |ssl_version|, which is defined in | 40 // specified by |ssl_version|, which is defined in |
| 35 // net/ssl/ssl_connection_status_flags.h. | 41 // net/ssl/ssl_connection_status_flags.h. |
| 36 // If the version is unknown, |name| is set to "???". | 42 // If the version is unknown, |name| is set to "???". |
| 37 NET_EXPORT void SSLVersionToString(const char** name, int ssl_version); | 43 NET_EXPORT void SSLVersionToString(const char** name, int ssl_version); |
| 38 | 44 |
| 39 // Parses a string literal that represents a SSL/TLS cipher suite. | 45 // Parses a string literal that represents a SSL/TLS cipher suite. |
| 40 // | 46 // |
| 41 // Supported literal forms: | 47 // Supported literal forms: |
| 42 // 0xAABB, where AA is cipher_suite[0] and BB is cipher_suite[1], as | 48 // 0xAABB, where AA is cipher_suite[0] and BB is cipher_suite[1], as |
| (...skipping 30 matching lines...) Expand all Loading... |
| 73 // - Cipher: not an AEAD cipher | 79 // - Cipher: not an AEAD cipher |
| 74 NET_EXPORT int ObsoleteSSLStatus(int connection_status); | 80 NET_EXPORT int ObsoleteSSLStatus(int connection_status); |
| 75 | 81 |
| 76 // Returns true if |cipher_suite| is suitable for use with HTTP/2. See | 82 // Returns true if |cipher_suite| is suitable for use with HTTP/2. See |
| 77 // https://http2.github.io/http2-spec/#rfc.section.9.2.2. | 83 // https://http2.github.io/http2-spec/#rfc.section.9.2.2. |
| 78 NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite); | 84 NET_EXPORT bool IsTLSCipherSuiteAllowedByHTTP2(uint16_t cipher_suite); |
| 79 | 85 |
| 80 } // namespace net | 86 } // namespace net |
| 81 | 87 |
| 82 #endif // NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ | 88 #endif // NET_SSL_SSL_CIPHER_SUITE_NAMES_H_ |
| OLD | NEW |