| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <pk11pub.h> | 8 #include <pk11pub.h> |
| 9 #include <prerror.h> | 9 #include <prerror.h> |
| 10 #include <prtime.h> | 10 #include <prtime.h> |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 cvin->push_back(in_param); | 455 cvin->push_back(in_param); |
| 456 in_param.type = cert_pi_end; | 456 in_param.type = cert_pi_end; |
| 457 cvin->push_back(in_param); | 457 cvin->push_back(in_param); |
| 458 rv = CERT_PKIXVerifyCert(cert_handle, certificateUsageSSLServer, | 458 rv = CERT_PKIXVerifyCert(cert_handle, certificateUsageSSLServer, |
| 459 &(*cvin)[0], cvout, NULL); | 459 &(*cvin)[0], cvout, NULL); |
| 460 if (rv == SECSuccess) | 460 if (rv == SECSuccess) |
| 461 return rv; | 461 return rv; |
| 462 int new_nss_error = PORT_GetError(); | 462 int new_nss_error = PORT_GetError(); |
| 463 if (new_nss_error == SEC_ERROR_INVALID_ARGS || | 463 if (new_nss_error == SEC_ERROR_INVALID_ARGS || |
| 464 new_nss_error == SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE || | 464 new_nss_error == SEC_ERROR_UNKNOWN_AIA_LOCATION_TYPE || |
| 465 new_nss_error == SEC_ERROR_BAD_HTTP_RESPONSE || |
| 466 new_nss_error == SEC_ERROR_BAD_LDAP_RESPONSE || |
| 465 !IS_SEC_ERROR(new_nss_error)) { | 467 !IS_SEC_ERROR(new_nss_error)) { |
| 466 // Use the original error code because of cert_pi_useAIACertFetch's | 468 // Use the original error code because of cert_pi_useAIACertFetch's |
| 467 // bad error reporting. | 469 // bad error reporting. |
| 468 PORT_SetError(nss_error); | 470 PORT_SetError(nss_error); |
| 469 return rv; | 471 return rv; |
| 470 } | 472 } |
| 471 nss_error = new_nss_error; | 473 nss_error = new_nss_error; |
| 472 } | 474 } |
| 473 | 475 |
| 474 // If an intermediate CA certificate has requireExplicitPolicy in its | 476 // If an intermediate CA certificate has requireExplicitPolicy in its |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 753 DCHECK(0 != cert->derCert.len); | 755 DCHECK(0 != cert->derCert.len); |
| 754 | 756 |
| 755 SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, sha1.data, | 757 SECStatus rv = HASH_HashBuf(HASH_AlgSHA1, sha1.data, |
| 756 cert->derCert.data, cert->derCert.len); | 758 cert->derCert.data, cert->derCert.len); |
| 757 DCHECK(rv == SECSuccess); | 759 DCHECK(rv == SECSuccess); |
| 758 | 760 |
| 759 return sha1; | 761 return sha1; |
| 760 } | 762 } |
| 761 | 763 |
| 762 } // namespace net | 764 } // namespace net |
| OLD | NEW |