| 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 #ifndef NET_BASE_X509_OPENSSL_UTIL_H_ | 5 #ifndef NET_BASE_X509_OPENSSL_UTIL_H_ |
| 6 #define NET_BASE_X509_OPENSSL_UTIL_H_ | 6 #define NET_BASE_X509_OPENSSL_UTIL_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <openssl/asn1.h> | 9 #include <openssl/asn1.h> |
| 10 #include <openssl/x509v3.h> | 10 #include <openssl/x509v3.h> |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 int index, | 26 int index, |
| 27 std::string* key, | 27 std::string* key, |
| 28 std::string* value); | 28 std::string* value); |
| 29 | 29 |
| 30 bool ParsePrincipalValueByIndex(X509_NAME* name, int index, std::string* value); | 30 bool ParsePrincipalValueByIndex(X509_NAME* name, int index, std::string* value); |
| 31 | 31 |
| 32 bool ParsePrincipalValueByNID(X509_NAME* name, int nid, std::string* value); | 32 bool ParsePrincipalValueByNID(X509_NAME* name, int nid, std::string* value); |
| 33 | 33 |
| 34 bool ParseDate(ASN1_TIME* x509_time, base::Time* time); | 34 bool ParseDate(ASN1_TIME* x509_time, base::Time* time); |
| 35 | 35 |
| 36 // Verifies that |hostname| matches one of the names in |cert_names|, based on | |
| 37 // TLS name matching rules, specifically following http://tools.ietf.org/html/dr
aft-saintandre-tls-server-id-check-09#section-4.4.3 | |
| 38 // The members of |cert_names| must have been extracted from the Subject CN or | |
| 39 // SAN fields of a certificate. | |
| 40 bool VerifyHostname(const std::string& hostname, | |
| 41 const std::vector<std::string>& cert_names); | |
| 42 | |
| 43 } // namespace x509_openssl_util | 36 } // namespace x509_openssl_util |
| 44 | 37 |
| 45 } // namespace net | 38 } // namespace net |
| 46 | 39 |
| 47 #endif // NET_BASE_X509_OPENSSL_UTIL_H_ | 40 #endif // NET_BASE_X509_OPENSSL_UTIL_H_ |
| OLD | NEW |