# include <openssl/opensslconf.h>
-# ifndef OPENSSL_NO_UI
-
-# if OPENSSL_API_COMPAT < 0x10100000L
-# include <openssl/crypto.h>
+# if OPENSSL_API_COMPAT < 0x10100000L
+# include <openssl/crypto.h>
+# endif
+# include <openssl/safestack.h>
+# include <openssl/pem.h>
+# include <openssl/ossl_typ.h>
+# include <openssl/uierr.h>
+
+/* For compatibility reasons, the macro OPENSSL_NO_UI is currently retained */
+# if OPENSSL_API_COMPAT < 0x10200000L
+# ifdef OPENSSL_NO_UI_CONSOLE
+# define OPENSSL_NO_UI
# endif
-# include <openssl/safestack.h>
-# include <openssl/pem.h>
-# include <openssl/ossl_typ.h>
-# include <openssl/uierr.h>
+# endif
-#ifdef __cplusplus
+# ifdef __cplusplus
extern "C" {
-#endif
+# endif
/*
* All the following functions return -1 or NULL on error and in some cases
* each UI being marked with this flag, or the application might get
* confused.
*/
-# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
+# define UI_INPUT_FLAG_DEFAULT_PWD 0x02
/*-
* The user of these routines may want to define flags of their own. The core
* #define MY_UI_FLAG1 (0x01 << UI_INPUT_FLAG_USER_BASE)
*
*/
-# define UI_INPUT_FLAG_USER_BASE 16
+# define UI_INPUT_FLAG_USER_BASE 16
/*-
* The following function helps construct a prompt. object_desc is a
* OpenSSL error stack before printing any info or added error messages and
* before any prompting.
*/
-# define UI_CTRL_PRINT_ERRORS 1
+# define UI_CTRL_PRINT_ERRORS 1
/*
* Check if a UI_process() is possible to do again with the same instance of
* a user interface. This makes UI_ctrl() return 1 if it is redoable, and 0
# define UI_set_app_data(s,arg) UI_set_ex_data(s,0,arg)
# define UI_get_app_data(s) UI_get_ex_data(s,0)
-#define UI_get_ex_new_index(l, p, newf, dupf, freef) \
+# define UI_get_ex_new_index(l, p, newf, dupf, freef) \
CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, l, p, newf, dupf, freef)
int UI_set_ex_data(UI *r, int idx, void *arg);
void *UI_get_ex_data(UI *r, int idx);
const UI_METHOD *UI_get_method(UI *ui);
const UI_METHOD *UI_set_method(UI *ui, const UI_METHOD *meth);
+# ifndef OPENSSL_NO_UI_CONSOLE
+
/* The method with all the built-in thingies */
UI_METHOD *UI_OpenSSL(void);
+# endif
+
/*
* NULL method. Literally does nothing, but may serve as a placeholder
* to avoid internal default.
int ERR_load_UI_strings(void);
-# ifdef __cplusplus
+# ifdef __cplusplus
}
-# endif
# endif
#endif