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/socket/nss_ssl_util.h" | 5 #include "net/socket/nss_ssl_util.h" |
6 | 6 |
7 #include <nss.h> | 7 #include <nss.h> |
8 #include <secerr.h> | 8 #include <secerr.h> |
9 #include <ssl.h> | 9 #include <ssl.h> |
10 #include <sslerr.h> | 10 #include <sslerr.h> |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 case SSL_ERROR_ILLEGAL_PARAMETER_ALERT: | 332 case SSL_ERROR_ILLEGAL_PARAMETER_ALERT: |
333 return ERR_SSL_PROTOCOL_ERROR; | 333 return ERR_SSL_PROTOCOL_ERROR; |
334 case SSL_ERROR_DECOMPRESSION_FAILURE_ALERT: | 334 case SSL_ERROR_DECOMPRESSION_FAILURE_ALERT: |
335 return ERR_SSL_DECOMPRESSION_FAILURE_ALERT; | 335 return ERR_SSL_DECOMPRESSION_FAILURE_ALERT; |
336 case SSL_ERROR_BAD_MAC_ALERT: | 336 case SSL_ERROR_BAD_MAC_ALERT: |
337 return ERR_SSL_BAD_RECORD_MAC_ALERT; | 337 return ERR_SSL_BAD_RECORD_MAC_ALERT; |
338 case SSL_ERROR_DECRYPT_ERROR_ALERT: | 338 case SSL_ERROR_DECRYPT_ERROR_ALERT: |
339 return ERR_SSL_DECRYPT_ERROR_ALERT; | 339 return ERR_SSL_DECRYPT_ERROR_ALERT; |
340 case SSL_ERROR_UNRECOGNIZED_NAME_ALERT: | 340 case SSL_ERROR_UNRECOGNIZED_NAME_ALERT: |
341 return ERR_SSL_UNRECOGNIZED_NAME_ALERT; | 341 return ERR_SSL_UNRECOGNIZED_NAME_ALERT; |
342 case SSL_ERROR_UNSAFE_NEGOTIATION: | |
343 return ERR_SSL_UNSAFE_NEGOTIATION; | |
344 case SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY: | 342 case SSL_ERROR_WEAK_SERVER_EPHEMERAL_DH_KEY: |
345 return ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY; | 343 return ERR_SSL_WEAK_SERVER_EPHEMERAL_DH_KEY; |
346 case SSL_ERROR_HANDSHAKE_NOT_COMPLETED: | 344 case SSL_ERROR_HANDSHAKE_NOT_COMPLETED: |
347 return ERR_SSL_HANDSHAKE_NOT_COMPLETED; | 345 return ERR_SSL_HANDSHAKE_NOT_COMPLETED; |
348 case SEC_ERROR_BAD_KEY: | 346 case SEC_ERROR_BAD_KEY: |
349 case SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE: | 347 case SSL_ERROR_EXTRACT_PUBLIC_KEY_FAILURE: |
350 // TODO(wtc): the following errors may also occur in contexts unrelated | 348 // TODO(wtc): the following errors may also occur in contexts unrelated |
351 // to the peer's public key. We should add new error codes for them, or | 349 // to the peer's public key. We should add new error codes for them, or |
352 // map them to ERR_SSL_BAD_PEER_PUBLIC_KEY only in the right context. | 350 // map them to ERR_SSL_BAD_PEER_PUBLIC_KEY only in the right context. |
353 // General unsupported/unknown key algorithm error. | 351 // General unsupported/unknown key algorithm error. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 base::Bind(&NetLogSSLFailedNSSFunctionCallback, | 403 base::Bind(&NetLogSSLFailedNSSFunctionCallback, |
406 function, param, PR_GetError())); | 404 function, param, PR_GetError())); |
407 } | 405 } |
408 | 406 |
409 NetLog::ParametersCallback CreateNetLogSSLErrorCallback(int net_error, | 407 NetLog::ParametersCallback CreateNetLogSSLErrorCallback(int net_error, |
410 int ssl_lib_error) { | 408 int ssl_lib_error) { |
411 return base::Bind(&NetLogSSLErrorCallback, net_error, ssl_lib_error); | 409 return base::Bind(&NetLogSSLErrorCallback, net_error, ssl_lib_error); |
412 } | 410 } |
413 | 411 |
414 } // namespace net | 412 } // namespace net |
OLD | NEW |