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 // OpenSSL binding for SSLClientSocket. The class layout and general principle | 5 // OpenSSL binding for SSLClientSocket. The class layout and general principle |
6 // of operation is derived from SSLClientSocketNSS. | 6 // of operation is derived from SSLClientSocketNSS. |
7 | 7 |
8 #include "net/socket/ssl_client_socket_openssl.h" | 8 #include "net/socket/ssl_client_socket_openssl.h" |
9 | 9 |
10 #include <openssl/ssl.h> | 10 #include <openssl/ssl.h> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 case SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED: | 128 case SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED: |
129 return ERR_SSL_UNSAFE_NEGOTIATION; | 129 return ERR_SSL_UNSAFE_NEGOTIATION; |
130 case SSL_R_WRONG_NUMBER_OF_KEY_BITS: | 130 case SSL_R_WRONG_NUMBER_OF_KEY_BITS: |
131 return ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY; | 131 return ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY; |
132 // SSL_R_UNKNOWN_PROTOCOL is reported if premature application data is | 132 // SSL_R_UNKNOWN_PROTOCOL is reported if premature application data is |
133 // received (see http://crbug.com/42538), and also if all the protocol | 133 // received (see http://crbug.com/42538), and also if all the protocol |
134 // versions supported by the server were disabled in this socket instance. | 134 // versions supported by the server were disabled in this socket instance. |
135 // Mapped to ERR_SSL_PROTOCOL_ERROR for compatibility with other SSL sockets | 135 // Mapped to ERR_SSL_PROTOCOL_ERROR for compatibility with other SSL sockets |
136 // in the former scenario. | 136 // in the former scenario. |
137 case SSL_R_UNKNOWN_PROTOCOL: | 137 case SSL_R_UNKNOWN_PROTOCOL: |
| 138 case SSL_R_UNSUPPORTED_PROTOCOL: |
138 case SSL_R_SSL_HANDSHAKE_FAILURE: | 139 case SSL_R_SSL_HANDSHAKE_FAILURE: |
139 case SSL_R_DECRYPTION_FAILED: | 140 case SSL_R_DECRYPTION_FAILED: |
140 case SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC: | 141 case SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC: |
141 case SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG: | 142 case SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG: |
142 case SSL_R_DIGEST_CHECK_FAILED: | 143 case SSL_R_DIGEST_CHECK_FAILED: |
143 case SSL_R_DUPLICATE_COMPRESSION_ID: | 144 case SSL_R_DUPLICATE_COMPRESSION_ID: |
144 case SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER: | 145 case SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER: |
145 case SSL_R_ENCRYPTED_LENGTH_TOO_LONG: | 146 case SSL_R_ENCRYPTED_LENGTH_TOO_LONG: |
146 case SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST: | 147 case SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST: |
147 case SSL_R_EXCESSIVE_MESSAGE_SIZE: | 148 case SSL_R_EXCESSIVE_MESSAGE_SIZE: |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1321 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, | 1322 net_log_.AddByteTransferEvent(NetLog::TYPE_SSL_SOCKET_BYTES_SENT, rv, |
1322 user_write_buf_->data()); | 1323 user_write_buf_->data()); |
1323 return rv; | 1324 return rv; |
1324 } | 1325 } |
1325 | 1326 |
1326 int err = SSL_get_error(ssl_, rv); | 1327 int err = SSL_get_error(ssl_, rv); |
1327 return MapOpenSSLError(err, err_tracer); | 1328 return MapOpenSSLError(err, err_tracer); |
1328 } | 1329 } |
1329 | 1330 |
1330 } // namespace net | 1331 } // namespace net |
OLD | NEW |