Rewrite RAND_egd
[openssl.git] / test / uitest.c
index 855dc45442df27dbc0a0365653dd0eb28db91989..6fef137b02681e29436a9d5cdfe9f99e0685ab5e 100644 (file)
 #include <string.h>
 #include <openssl/opensslconf.h>
 #include <openssl/err.h>
-#include "../apps/apps.h"
+#include "apps.h"
 #include "testutil.h"
 
 /* apps/apps.c depend on these */
 char *default_config_file = NULL;
 
-#ifndef OPENSSL_NO_UI
-# include <openssl/ui.h>
+#include <openssl/ui.h>
 
 /* Old style PEM password callback */
 static int test_pem_password_cb(char *buf, int size, int rwflag, void *userdata)
 {
     OPENSSL_strlcpy(buf, (char *)userdata, (size_t)size);
-    return 1;
+    return strlen(buf);
 }
 
 /*
@@ -89,12 +88,8 @@ static int test_new_ui()
     return ok;
 }
 
-#endif
-
 void register_tests(void)
 {
-#ifndef OPENSSL_NO_UI
     ADD_TEST(test_old);
     ADD_TEST(test_new_ui);
-#endif
 }