summaryrefslogtreecommitdiff
path: root/test/ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/ssl.c')
-rw-r--r--test/ssl.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/test/ssl.c b/test/ssl.c
index ece9a64..7cd40cf 100644
--- a/test/ssl.c
+++ b/test/ssl.c
@@ -231,13 +231,13 @@ static int any_ssl_request(ne_session *sess, server_fn fn, void *server_ud,
static int init(void)
{
- /* take srcdir as argv[1]. */
+ /* take srcdir as argv[1] for VPATH builds. */
if (test_argc > 1) {
- srcdir = test_argv[1];
- server_key = ne_concat(srcdir, "/server.key", NULL);
- } else {
- server_key = "server.key";
+ srcdir = test_argv[1];
}
+
+ /* take srcdir as argv[1]. */
+ server_key = "server.key";
if (ne_sock_init()) {
t_context("could not initialize socket/SSL library.");
@@ -926,24 +926,18 @@ static int fail_nul_san(void)
/* Check that an expired certificate is flagged as such. */
static int fail_expired(void)
{
- char *c = ne_concat(srcdir, "/expired.cert", NULL);
- CALL(fail_ssl_request_with_error(c, CA_CERT, "localhost",
- "expired certificate was accepted",
- NE_SSL_EXPIRED,
- "certificate has expired"));
- ne_free(c);
- return OK;
+ return fail_ssl_request_with_error("expired.cert", CA_CERT, "localhost",
+ "expired certificate was accepted",
+ NE_SSL_EXPIRED,
+ "certificate has expired");
}
static int fail_notvalid(void)
{
- char *c = ne_concat(srcdir, "/notyet.cert", NULL);
- CALL(fail_ssl_request_with_error(c, CA_CERT, "localhost",
- "not yet valid certificate was accepted",
- NE_SSL_NOTYETVALID,
- "certificate is not yet valid"));
- ne_free(c);
- return OK;
+ return fail_ssl_request_with_error("notyet.cert", CA_CERT, "localhost",
+ "not yet valid certificate was accepted",
+ NE_SSL_NOTYETVALID,
+ "certificate is not yet valid");
}
/* Check that a server cert with a random issuer and self-signed cert