| 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/base/x509_certificate.h" | 5 #include "net/base/x509_certificate.h" |
| 6 | 6 |
| 7 #include <cert.h> | 7 #include <cert.h> |
| 8 #include <cryptohi.h> | 8 #include <cryptohi.h> |
| 9 #include <keyhi.h> | 9 #include <keyhi.h> |
| 10 #include <nss.h> | 10 #include <nss.h> |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 if (ip_addrs) | 837 if (ip_addrs) |
| 838 ip_addrs->clear(); | 838 ip_addrs->clear(); |
| 839 | 839 |
| 840 SECItem alt_name; | 840 SECItem alt_name; |
| 841 SECStatus rv = CERT_FindCertExtension(cert_handle_, | 841 SECStatus rv = CERT_FindCertExtension(cert_handle_, |
| 842 SEC_OID_X509_SUBJECT_ALT_NAME, | 842 SEC_OID_X509_SUBJECT_ALT_NAME, |
| 843 &alt_name); | 843 &alt_name); |
| 844 if (rv != SECSuccess) | 844 if (rv != SECSuccess) |
| 845 return; | 845 return; |
| 846 | 846 |
| 847 PRArenaPool* arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); | 847 PLArenaPool* arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE); |
| 848 DCHECK(arena != NULL); | 848 DCHECK(arena != NULL); |
| 849 | 849 |
| 850 CERTGeneralName* alt_name_list; | 850 CERTGeneralName* alt_name_list; |
| 851 alt_name_list = CERT_DecodeAltNameExtension(arena, &alt_name); | 851 alt_name_list = CERT_DecodeAltNameExtension(arena, &alt_name); |
| 852 SECITEM_FreeItem(&alt_name, PR_FALSE); | 852 SECITEM_FreeItem(&alt_name, PR_FALSE); |
| 853 | 853 |
| 854 CERTGeneralName* name = alt_name_list; | 854 CERTGeneralName* name = alt_name_list; |
| 855 while (name) { | 855 while (name) { |
| 856 // DNSName and IPAddress are encoded as IA5String and OCTET STRINGs | 856 // DNSName and IPAddress are encoded as IA5String and OCTET STRINGs |
| 857 // respectively, both of which can be byte copied from | 857 // respectively, both of which can be byte copied from |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1191 *type = kPublicKeyTypeECDSA; | 1191 *type = kPublicKeyTypeECDSA; |
| 1192 break; | 1192 break; |
| 1193 default: | 1193 default: |
| 1194 *type = kPublicKeyTypeUnknown; | 1194 *type = kPublicKeyTypeUnknown; |
| 1195 *size_bits = 0; | 1195 *size_bits = 0; |
| 1196 break; | 1196 break; |
| 1197 } | 1197 } |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 } // namespace net | 1200 } // namespace net |
| OLD | NEW |