summaryrefslogtreecommitdiffstats
path: root/crypto/ui
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2001-09-01 20:02:13 +0000
committerGeoff Thorpe <geoff@openssl.org>2001-09-01 20:02:13 +0000
commit79aa04ef27f69a1149d4d0e72d2d2953b6241ef0 (patch)
tree28eb317ea6bcd7f391cffe2fe694e92224ce1ff8 /crypto/ui
parent3a0799977bcb154d044828e96a25a01eb478de51 (diff)
Make the necessary changes to work with the recent "ex_data" overhaul.
See the commit log message for that for more information. NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented (initialisation by "memset" won't/can't/doesn't work). This fixes that but requires that X509_STORE_CTX_init() be able to handle errors - so its prototype has been changed to return 'int' rather than 'void'. All uses of that function throughout the source code have been tracked down and adjusted.
Diffstat (limited to 'crypto/ui')
-rw-r--r--crypto/ui/ui_lib.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/crypto/ui/ui_lib.c b/crypto/ui/ui_lib.c
index c526426f8b..16946cad95 100644
--- a/crypto/ui/ui_lib.c
+++ b/crypto/ui/ui_lib.c
@@ -66,8 +66,6 @@
IMPLEMENT_STACK_OF(UI_STRING_ST)
static const UI_METHOD *default_UI_meth=NULL;
-static int ui_meth_num=0;
-static STACK_OF(CRYPTO_EX_DATA_FUNCS) *ui_meth=NULL;
UI *UI_new(void)
{
@@ -91,7 +89,7 @@ UI *UI_new_method(const UI_METHOD *method)
ret->strings=NULL;
ret->user_data=NULL;
- CRYPTO_new_ex_data(ui_meth,ret,&ret->ex_data);
+ CRYPTO_new_ex_data(CRYPTO_EX_INDEX_UI, ret, &ret->ex_data);
return ret;
}
@@ -119,6 +117,7 @@ void UI_free(UI *ui)
if (ui == NULL)
return;
sk_UI_STRING_pop_free(ui->strings,free_string);
+ CRYPTO_free_ex_data(CRYPTO_EX_INDEX_UI, ui, &ui->ex_data);
OPENSSL_free(ui);
}
@@ -574,10 +573,8 @@ int UI_ctrl(UI *ui, int cmd, long i, void *p, void (*f)())
int UI_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- if(CRYPTO_get_ex_new_index(ui_meth_num, &ui_meth, argl, argp,
- new_func, dup_func, free_func) < 0)
- return -1;
- return (ui_meth_num++);
+ return CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_UI, argl, argp,
+ new_func, dup_func, free_func);
}
int UI_set_ex_data(UI *r, int idx, void *arg)