test: add import and export key management hooks for the TLS provider.
[openssl.git] / test / afalgtest.c
index bf9054554ae8fc627ca8d67fb82b92feabc83982..6e6bbd5530ce0097fe3df9a57382495058d1e813 100644 (file)
@@ -1,12 +1,15 @@
 /*
- * Copyright 2016-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
- * Licensed under the OpenSSL license (the "License").  You may not use
+ * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
 
+/* We need to use some engine deprecated APIs */
+#define OPENSSL_SUPPRESS_DEPRECATED
+
 #include <stdio.h>
 #include <openssl/opensslconf.h>
 
@@ -128,14 +131,14 @@ int global_init(void)
 int setup_tests(void)
 {
 #ifndef OPENSSL_NO_ENGINE
-    if (!TEST_ptr(e = ENGINE_by_id("afalg"))) {
+    if ((e = ENGINE_by_id("afalg")) == NULL) {
         /* Probably a platform env issue, not a test failure. */
-        TEST_info("Can't load AFALG engine, you might want to check $OPENSSL_ENGINES");
-        return 0;
-    }
+        TEST_info("Can't load AFALG engine");
+    } else {
 # ifndef OPENSSL_NO_AFALGENG
-    ADD_ALL_TESTS(test_afalg_aes_cbc, 3);
+        ADD_ALL_TESTS(test_afalg_aes_cbc, 3);
 # endif
+    }
 #endif
 
     return 1;