diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-03-25 13:46:02 +0100 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-04-02 18:31:06 +0200 |
commit | 4b1fe471ac99b9f8692be85dcbcbf6977eb35c78 (patch) | |
tree | 1589302a8fad703bc2e626a45bddffa5f0d6c4d9 /test | |
parent | afe554c2d244b4e7fc8c1b14acef806a2a581a8d (diff) |
HTTP client: make server/proxy and port params more consistent; minor other improvements
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/11404)
Diffstat (limited to 'test')
-rw-r--r-- | test/build.info | 6 | ||||
-rw-r--r-- | test/cmp_ctx_test.c | 11 |
2 files changed, 10 insertions, 7 deletions
diff --git a/test/build.info b/test/build.info index b6c3a6e4bb..6d670ea175 100644 --- a/test/build.info +++ b/test/build.info @@ -51,7 +51,7 @@ IF[{- !$disabled{tests} -}] x509_time_test x509_dup_cert_test x509_check_cert_pkey_test \ recordlentest drbgtest drbg_cavs_test drbg_extra_test sslbuffertest \ time_offset_test pemtest ssl_cert_table_internal_test ciphername_test \ - servername_test ocspapitest fatalerrtest tls13ccstest \ + http_test servername_test ocspapitest fatalerrtest tls13ccstest \ sysdefaulttest errtest ssl_ctx_test gosttest \ context_internal_test aesgcmtest params_test evp_pkey_dparams_test \ keymgmt_internal_test @@ -380,6 +380,10 @@ IF[{- !$disabled{tests} -}] INCLUDE[ciphername_test]=../include ../apps/include DEPEND[ciphername_test]=../libcrypto ../libssl libtestutil.a + SOURCE[http_test]=http_test.c + INCLUDE[http_test]=../include ../apps/include + DEPEND[http_test]=../libcrypto libtestutil.a + SOURCE[servername_test]=servername_test.c ssltestlib.c INCLUDE[servername_test]=../include ../apps/include DEPEND[servername_test]=../libcrypto ../libssl libtestutil.a diff --git a/test/cmp_ctx_test.c b/test/cmp_ctx_test.c index 1708960687..e6b42db11b 100644 --- a/test/cmp_ctx_test.c +++ b/test/cmp_ctx_test.c @@ -492,7 +492,6 @@ static X509_STORE *X509_STORE_new_1(void) #define IS_NEG(x) ((x) < 0) #define IS_0(x) ((x) == 0) /* for any type */ -#define IS_DEFAULT_PORT(x) ((x) == OSSL_CMP_DEFAULT_PORT) #define DROP(x) (void)(x) /* dummy free() for non-pointer and function types */ #define ERR(x) (CMPerr(0, CMP_R_NULL_ARGUMENT), x) @@ -555,12 +554,12 @@ typedef OSSL_HTTP_bio_cb_t OSSL_CMP_http_cb_t; DEFAULT, 1, DROP) #define DEFINE_SET_GET_INT_TEST(OSSL_CMP, CTX, FIELD) \ DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, IS_NEG) -#define DEFINE_SET_PORT_TEST(FIELD) \ +#define DEFINE_SET_INT_TEST(FIELD) \ static int OSSL_CMP_CTX_get_##FIELD(const CMP_CTX *ctx) \ { \ return ctx == NULL ? ERR(-1) : ctx->FIELD; \ } \ - DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, IS_DEFAULT_PORT) + DEFINE_SET_GET_INT_TEST_DEFAULT(OSSL_CMP, CTX, FIELD, IS_0) #define DEFINE_SET_GET_ARG_FN(SETN, GETN, FIELD, ARG, T) \ static int OSSL_CMP_CTX_##SETN##_##FIELD##_##ARG(CMP_CTX *ctx, T val) \ @@ -716,8 +715,8 @@ DEFINE_SET_GET_BASE_TEST(OSSL_CMP_CTX, set, get, 0, option_16, int, -1, IS_0, \ DEFINE_SET_CB_TEST(log_cb) DEFINE_SET_TEST_DEFAULT(OSSL_CMP, CTX, 1, 1, serverPath, char, IS_0) -DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, serverName, char) -DEFINE_SET_PORT_TEST(serverPort) +DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, server, char) +DEFINE_SET_INT_TEST(serverPort) DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, proxy, char) DEFINE_SET_TEST(OSSL_CMP, CTX, 1, 1, no_proxy, char) DEFINE_SET_CB_TEST(http_cb) @@ -801,7 +800,7 @@ int setup_tests(void) #endif /* message transfer: */ ADD_TEST(test_CTX_set1_get0_serverPath); - ADD_TEST(test_CTX_set1_get0_serverName); + ADD_TEST(test_CTX_set1_get0_server); ADD_TEST(test_CTX_set_get_serverPort); ADD_TEST(test_CTX_set1_get0_proxy); ADD_TEST(test_CTX_set1_get0_no_proxy); |