OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived | 5 // This file includes code SSLClientSocketNSS::DoVerifyCertComplete() derived |
6 // from AuthCertificateCallback() in | 6 // from AuthCertificateCallback() in |
7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. | 7 // mozilla/security/manager/ssl/src/nsNSSCallbacks.cpp. |
8 | 8 |
9 /* ***** BEGIN LICENSE BLOCK ***** | 9 /* ***** BEGIN LICENSE BLOCK ***** |
10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 10 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1371 // See _MD_unix_map_default_error in the NSS source | 1371 // See _MD_unix_map_default_error in the NSS source |
1372 // tree for inspiration. | 1372 // tree for inspiration. |
1373 static PRErrorCode MapErrorToNSS(int result) { | 1373 static PRErrorCode MapErrorToNSS(int result) { |
1374 if (result >=0) | 1374 if (result >=0) |
1375 return result; | 1375 return result; |
1376 | 1376 |
1377 switch (result) { | 1377 switch (result) { |
1378 case ERR_IO_PENDING: | 1378 case ERR_IO_PENDING: |
1379 return PR_WOULD_BLOCK_ERROR; | 1379 return PR_WOULD_BLOCK_ERROR; |
1380 case ERR_ACCESS_DENIED: | 1380 case ERR_ACCESS_DENIED: |
| 1381 case ERR_NETWORK_ACCESS_DENIED: |
1381 // For connect, this could be mapped to PR_ADDRESS_NOT_SUPPORTED_ERROR. | 1382 // For connect, this could be mapped to PR_ADDRESS_NOT_SUPPORTED_ERROR. |
1382 return PR_NO_ACCESS_RIGHTS_ERROR; | 1383 return PR_NO_ACCESS_RIGHTS_ERROR; |
1383 case ERR_INTERNET_DISCONNECTED: // Equivalent to ENETDOWN. | 1384 case ERR_INTERNET_DISCONNECTED: // Equivalent to ENETDOWN. |
1384 return PR_NETWORK_UNREACHABLE_ERROR; // Best approximation. | 1385 return PR_NETWORK_UNREACHABLE_ERROR; // Best approximation. |
1385 case ERR_CONNECTION_TIMED_OUT: | 1386 case ERR_CONNECTION_TIMED_OUT: |
1386 case ERR_TIMED_OUT: | 1387 case ERR_TIMED_OUT: |
1387 return PR_IO_TIMEOUT_ERROR; | 1388 return PR_IO_TIMEOUT_ERROR; |
1388 case ERR_CONNECTION_RESET: | 1389 case ERR_CONNECTION_RESET: |
1389 return PR_CONNECT_RESET_ERROR; | 1390 return PR_CONNECT_RESET_ERROR; |
1390 case ERR_CONNECTION_ABORTED: | 1391 case ERR_CONNECTION_ABORTED: |
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 return ERR_IO_PENDING; | 2335 return ERR_IO_PENDING; |
2335 } | 2336 } |
2336 LeaveFunction(""); | 2337 LeaveFunction(""); |
2337 rv = MapNSPRError(prerr); | 2338 rv = MapNSPRError(prerr); |
2338 net_log_.AddEvent(NetLog::TYPE_SSL_WRITE_ERROR, | 2339 net_log_.AddEvent(NetLog::TYPE_SSL_WRITE_ERROR, |
2339 new SSLErrorParams(rv, prerr)); | 2340 new SSLErrorParams(rv, prerr)); |
2340 return rv; | 2341 return rv; |
2341 } | 2342 } |
2342 | 2343 |
2343 } // namespace net | 2344 } // namespace net |
OLD | NEW |