diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libtls/tls_verify.c (renamed from src/lib/libressl/ressl_verify.c) | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/libressl/ressl_verify.c b/src/lib/libtls/tls_verify.c index 5e9f370e1c..fa0010922f 100644 --- a/src/lib/libressl/ressl_verify.c +++ b/src/lib/libtls/tls_verify.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ressl_verify.c,v 1.5 2014/10/06 11:55:48 jca Exp $ */ | 1 | /* $OpenBSD: tls_verify.c,v 1.1 2014/10/31 13:46:17 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> | 3 | * Copyright (c) 2014 Jeremie Courreges-Anglas <jca@openbsd.org> |
4 | * | 4 | * |
@@ -24,14 +24,14 @@ | |||
24 | 24 | ||
25 | #include <openssl/x509v3.h> | 25 | #include <openssl/x509v3.h> |
26 | 26 | ||
27 | #include "ressl_internal.h" | 27 | #include "tls_internal.h" |
28 | 28 | ||
29 | int ressl_match_hostname(const char *cert_hostname, const char *hostname); | 29 | int tls_match_hostname(const char *cert_hostname, const char *hostname); |
30 | int ressl_check_subject_altname(X509 *cert, const char *host); | 30 | int tls_check_subject_altname(X509 *cert, const char *host); |
31 | int ressl_check_common_name(X509 *cert, const char *host); | 31 | int tls_check_common_name(X509 *cert, const char *host); |
32 | 32 | ||
33 | int | 33 | int |
34 | ressl_match_hostname(const char *cert_hostname, const char *hostname) | 34 | tls_match_hostname(const char *cert_hostname, const char *hostname) |
35 | { | 35 | { |
36 | const char *cert_domain, *domain, *next_dot; | 36 | const char *cert_domain, *domain, *next_dot; |
37 | 37 | ||
@@ -80,7 +80,7 @@ ressl_match_hostname(const char *cert_hostname, const char *hostname) | |||
80 | } | 80 | } |
81 | 81 | ||
82 | int | 82 | int |
83 | ressl_check_subject_altname(X509 *cert, const char *host) | 83 | tls_check_subject_altname(X509 *cert, const char *host) |
84 | { | 84 | { |
85 | STACK_OF(GENERAL_NAME) *altname_stack = NULL; | 85 | STACK_OF(GENERAL_NAME) *altname_stack = NULL; |
86 | union { struct in_addr ip4; struct in6_addr ip6; } addrbuf; | 86 | union { struct in_addr ip4; struct in6_addr ip6; } addrbuf; |
@@ -131,7 +131,7 @@ ressl_check_subject_altname(X509 *cert, const char *host) | |||
131 | break; | 131 | break; |
132 | } | 132 | } |
133 | 133 | ||
134 | if (ressl_match_hostname(data, host) == 0) { | 134 | if (tls_match_hostname(data, host) == 0) { |
135 | rv = 0; | 135 | rv = 0; |
136 | break; | 136 | break; |
137 | } | 137 | } |
@@ -160,7 +160,7 @@ ressl_check_subject_altname(X509 *cert, const char *host) | |||
160 | } | 160 | } |
161 | 161 | ||
162 | int | 162 | int |
163 | ressl_check_common_name(X509 *cert, const char *host) | 163 | tls_check_common_name(X509 *cert, const char *host) |
164 | { | 164 | { |
165 | X509_NAME *name; | 165 | X509_NAME *name; |
166 | char *common_name = NULL; | 166 | char *common_name = NULL; |
@@ -205,7 +205,7 @@ ressl_check_common_name(X509 *cert, const char *host) | |||
205 | goto out; | 205 | goto out; |
206 | } | 206 | } |
207 | 207 | ||
208 | if (ressl_match_hostname(common_name, host) == 0) | 208 | if (tls_match_hostname(common_name, host) == 0) |
209 | rv = 0; | 209 | rv = 0; |
210 | out: | 210 | out: |
211 | free(common_name); | 211 | free(common_name); |
@@ -213,13 +213,13 @@ out: | |||
213 | } | 213 | } |
214 | 214 | ||
215 | int | 215 | int |
216 | ressl_check_hostname(X509 *cert, const char *host) | 216 | tls_check_hostname(X509 *cert, const char *host) |
217 | { | 217 | { |
218 | int rv; | 218 | int rv; |
219 | 219 | ||
220 | rv = ressl_check_subject_altname(cert, host); | 220 | rv = tls_check_subject_altname(cert, host); |
221 | if (rv == 0 || rv == -2) | 221 | if (rv == 0 || rv == -2) |
222 | return rv; | 222 | return rv; |
223 | 223 | ||
224 | return ressl_check_common_name(cert, host); | 224 | return tls_check_common_name(cert, host); |
225 | } | 225 | } |