Adapt two test programs that were using now deprecated functions
authorRichard Levitte <levitte@openssl.org>
Fri, 8 Mar 2019 00:09:44 +0000 (01:09 +0100)
committerRichard Levitte <levitte@openssl.org>
Sun, 3 Nov 2019 17:38:23 +0000 (18:38 +0100)
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8442)

test/danetest.c
test/ssltest_old.c

index 26745f908edf0e32588724604a5112e72a7fd5fe..2c228ecc52b53208847480580c03ab823e86dd47 100644 (file)
@@ -393,7 +393,7 @@ static int run_tlsatest(void)
     if (!TEST_ptr(f = BIO_new_file(tlsafile, "r"))
             || !TEST_ptr(ctx = SSL_CTX_new(TLS_client_method()))
             || !TEST_int_gt(SSL_CTX_dane_enable(ctx), 0)
-            || !TEST_true(SSL_CTX_load_verify_locations(ctx, CAfile, NULL))
+            || !TEST_true(SSL_CTX_load_verify_file(ctx, CAfile))
             || !TEST_int_gt(SSL_CTX_dane_mtype_set(ctx, EVP_sha512(), 2, 1),
                             0)
             || !TEST_int_gt(SSL_CTX_dane_mtype_set(ctx, EVP_sha256(), 1, 2),
index 971015c6e67f2e688ac43fe4220e8dc7816efa75..050470d33e685fff1b4af47371742e24de1ae79b 100644 (file)
@@ -1492,12 +1492,15 @@ int main(int argc, char *argv[])
     (void)no_dhe;
 #endif
 
-    if ((!SSL_CTX_load_verify_locations(s_ctx, CAfile, CApath)) ||
-        (!SSL_CTX_set_default_verify_paths(s_ctx)) ||
-        (!SSL_CTX_load_verify_locations(s_ctx2, CAfile, CApath)) ||
-        (!SSL_CTX_set_default_verify_paths(s_ctx2)) ||
-        (!SSL_CTX_load_verify_locations(c_ctx, CAfile, CApath)) ||
-        (!SSL_CTX_set_default_verify_paths(c_ctx))) {
+    if (!(SSL_CTX_load_verify_file(s_ctx, CAfile)
+          || SSL_CTX_load_verify_dir(s_ctx, CApath))
+        || !SSL_CTX_set_default_verify_paths(s_ctx)
+        || !(SSL_CTX_load_verify_file(s_ctx2, CAfile)
+             || SSL_CTX_load_verify_dir(s_ctx2, CApath))
+        || !SSL_CTX_set_default_verify_paths(s_ctx2)
+        || !(SSL_CTX_load_verify_file(c_ctx, CAfile)
+             || SSL_CTX_load_verify_dir(c_ctx, CApath))
+        || !SSL_CTX_set_default_verify_paths(c_ctx)) {
         ERR_print_errors(bio_err);
     }