diff options
Diffstat (limited to 'src/lib/libcrypto/x509/x509_vpm.c')
-rw-r--r-- | src/lib/libcrypto/x509/x509_vpm.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/lib/libcrypto/x509/x509_vpm.c b/src/lib/libcrypto/x509/x509_vpm.c index 24ea72b4fe..19091b12aa 100644 --- a/src/lib/libcrypto/x509/x509_vpm.c +++ b/src/lib/libcrypto/x509/x509_vpm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_vpm.c,v 1.54 2025/03/19 16:35:11 tb Exp $ */ | 1 | /* $OpenBSD: x509_vpm.c,v 1.56 2025/05/10 05:54:39 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2004. | 3 | * project 2004. |
4 | */ | 4 | */ |
@@ -61,12 +61,12 @@ | |||
61 | 61 | ||
62 | #include <openssl/buffer.h> | 62 | #include <openssl/buffer.h> |
63 | #include <openssl/crypto.h> | 63 | #include <openssl/crypto.h> |
64 | #include <openssl/err.h> | ||
65 | #include <openssl/lhash.h> | 64 | #include <openssl/lhash.h> |
66 | #include <openssl/stack.h> | 65 | #include <openssl/stack.h> |
67 | #include <openssl/x509.h> | 66 | #include <openssl/x509.h> |
68 | #include <openssl/x509v3.h> | 67 | #include <openssl/x509v3.h> |
69 | 68 | ||
69 | #include "err_local.h" | ||
70 | #include "x509_local.h" | 70 | #include "x509_local.h" |
71 | 71 | ||
72 | /* X509_VERIFY_PARAM functions */ | 72 | /* X509_VERIFY_PARAM functions */ |
@@ -113,7 +113,7 @@ sk_OPENSSL_STRING_deep_copy(const STACK_OF(OPENSSL_STRING) *sk) | |||
113 | } | 113 | } |
114 | 114 | ||
115 | static int | 115 | static int |
116 | x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | 116 | x509_param_set_hosts_internal(X509_VERIFY_PARAM *param, int mode, |
117 | const char *name, size_t namelen) | 117 | const char *name, size_t namelen) |
118 | { | 118 | { |
119 | char *copy; | 119 | char *copy; |
@@ -126,9 +126,9 @@ x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | |||
126 | if (name && memchr(name, '\0', namelen)) | 126 | if (name && memchr(name, '\0', namelen)) |
127 | return 0; | 127 | return 0; |
128 | 128 | ||
129 | if (mode == SET_HOST && vpm->hosts) { | 129 | if (mode == SET_HOST && param->hosts) { |
130 | sk_OPENSSL_STRING_pop_free(vpm->hosts, str_free); | 130 | sk_OPENSSL_STRING_pop_free(param->hosts, str_free); |
131 | vpm->hosts = NULL; | 131 | param->hosts = NULL; |
132 | } | 132 | } |
133 | if (name == NULL || namelen == 0) | 133 | if (name == NULL || namelen == 0) |
134 | return 1; | 134 | return 1; |
@@ -136,17 +136,17 @@ x509_param_set_hosts_internal(X509_VERIFY_PARAM *vpm, int mode, | |||
136 | if (copy == NULL) | 136 | if (copy == NULL) |
137 | return 0; | 137 | return 0; |
138 | 138 | ||
139 | if (vpm->hosts == NULL && | 139 | if (param->hosts == NULL && |
140 | (vpm->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { | 140 | (param->hosts = sk_OPENSSL_STRING_new_null()) == NULL) { |
141 | free(copy); | 141 | free(copy); |
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | if (!sk_OPENSSL_STRING_push(vpm->hosts, copy)) { | 145 | if (!sk_OPENSSL_STRING_push(param->hosts, copy)) { |
146 | free(copy); | 146 | free(copy); |
147 | if (sk_OPENSSL_STRING_num(vpm->hosts) == 0) { | 147 | if (sk_OPENSSL_STRING_num(param->hosts) == 0) { |
148 | sk_OPENSSL_STRING_free(vpm->hosts); | 148 | sk_OPENSSL_STRING_free(param->hosts); |
149 | vpm->hosts = NULL; | 149 | param->hosts = NULL; |
150 | } | 150 | } |
151 | return 0; | 151 | return 0; |
152 | } | 152 | } |