return 0;
}
- /* Copy the host flags if and only if we're copying the host list */
+ x509_verify_param_copy(hostflags, 0);
+
if (test_x509_verify_param_copy(hosts, NULL)) {
sk_OPENSSL_STRING_pop_free(dest->hosts, str_free);
dest->hosts = NULL;
sk_OPENSSL_STRING_deep_copy(src->hosts, str_copy, str_free);
if (dest->hosts == NULL)
return 0;
- dest->hostflags = src->hostflags;
}
}
#include <openssl/core_dispatch.h>
#include <openssl/provider.h>
#include <openssl/param_build.h>
+#include <openssl/x509v3.h>
#include "helpers/ssltestlib.h"
#include "testutil.h"
}
#endif
+static int test_inherit_verify_param(void)
+{
+ int testresult = 0;
+
+ SSL_CTX *ctx = NULL;
+ X509_VERIFY_PARAM *cp = NULL;
+ SSL *ssl = NULL;
+ X509_VERIFY_PARAM *sp = NULL;
+ int hostflags = X509_CHECK_FLAG_NEVER_CHECK_SUBJECT;
+
+ ctx = SSL_CTX_new_ex(libctx, NULL, TLS_server_method());
+ if (!TEST_ptr(ctx))
+ goto end;
+
+ cp = SSL_CTX_get0_param(ctx);
+ if (!TEST_ptr(cp))
+ goto end;
+ if (!TEST_int_eq(X509_VERIFY_PARAM_get_hostflags(cp), 0))
+ goto end;
+
+ X509_VERIFY_PARAM_set_hostflags(cp, hostflags);
+
+ ssl = SSL_new(ctx);
+ if (!TEST_ptr(ssl))
+ goto end;
+
+ sp = SSL_get0_param(ssl);
+ if (!TEST_ptr(sp))
+ goto end;
+ if (!TEST_int_eq(X509_VERIFY_PARAM_get_hostflags(sp), hostflags))
+ goto end;
+
+ testresult = 1;
+
+ end:
+ SSL_free(ssl);
+ SSL_CTX_free(ctx);
+
+ return testresult;
+}
+
OPT_TEST_DECLARE_USAGE("certfile privkeyfile srpvfile tmpfile provider config\n")
int setup_tests(void)
#ifndef OSSL_NO_USABLE_TLS1_3
ADD_TEST(test_sni_tls13);
#endif
+ ADD_TEST(test_inherit_verify_param);
return 1;
err: