summaryrefslogtreecommitdiffstats
path: root/ssl
diff options
context:
space:
mode:
Diffstat (limited to 'ssl')
-rw-r--r--ssl/ssl_lib.c14
-rw-r--r--ssl/ssl_sess.c8
2 files changed, 12 insertions, 10 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index f4dfdbf250..df085e6a02 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -2051,9 +2051,10 @@ long SSL_get_verify_result(SSL *ssl)
int SSL_get_ex_new_index(long argl,void *argp,CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func,CRYPTO_EX_free *free_func)
{
- ssl_meth_num++;
- return(CRYPTO_get_ex_new_index(ssl_meth_num-1,
- &ssl_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(ssl_meth_num, &ssl_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (ssl_meth_num++);
}
int SSL_set_ex_data(SSL *s,int idx,void *arg)
@@ -2069,9 +2070,10 @@ void *SSL_get_ex_data(SSL *s,int idx)
int SSL_CTX_get_ex_new_index(long argl,void *argp,CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func,CRYPTO_EX_free *free_func)
{
- ssl_ctx_meth_num++;
- return(CRYPTO_get_ex_new_index(ssl_ctx_meth_num-1,
- &ssl_ctx_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(ssl_ctx_meth_num, &ssl_ctx_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (ssl_ctx_meth_num++);
}
int SSL_CTX_set_ex_data(SSL_CTX *s,int idx,void *arg)
diff --git a/ssl/ssl_sess.c b/ssl/ssl_sess.c
index 1b87de9d21..5821792b76 100644
--- a/ssl/ssl_sess.c
+++ b/ssl/ssl_sess.c
@@ -91,10 +91,10 @@ SSL_SESSION *SSL_get1_session(SSL *ssl)
int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- ssl_session_num++;
- return(CRYPTO_get_ex_new_index(ssl_session_num-1,
- &ssl_session_meth,
- argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(ssl_session_num, &ssl_session_meth, argl,
+ argp, new_func, dup_func, free_func) < 0)
+ return -1;
+ return (ssl_session_num++);
}
int SSL_SESSION_set_ex_data(SSL_SESSION *s, int idx, void *arg)