int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- x509_meth_num++;
- return(CRYPTO_get_ex_new_index(x509_meth_num-1,
- &x509_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(x509_meth_num, &x509_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (x509_meth_num++);
}
int X509_set_ex_data(X509 *r, int idx, void *arg)
int BIO_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- bio_meth_num++;
- return(CRYPTO_get_ex_new_index(bio_meth_num-1,&bio_meth,
- argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(bio_meth_num, &bio_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (bio_meth_num++);
}
int BIO_set_ex_data(BIO *bio, int idx, void *data)
int DH_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- dh_meth_num++;
- return(CRYPTO_get_ex_new_index(dh_meth_num-1,
- &dh_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(dh_meth_num, &dh_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (dh_meth_num++);
}
int DH_set_ex_data(DH *d, int idx, void *arg)
int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- dsa_meth_num++;
- return(CRYPTO_get_ex_new_index(dsa_meth_num-1,
- &dsa_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(dsa_meth_num, &dsa_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (dsa_meth_num++);
}
int DSA_set_ex_data(DSA *d, int idx, void *arg)
int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func)
{
- rsa_meth_num++;
- return(CRYPTO_get_ex_new_index(rsa_meth_num-1,
- &rsa_meth,argl,argp,new_func,dup_func,free_func));
+ if(CRYPTO_get_ex_new_index(rsa_meth_num, &rsa_meth, argl, argp,
+ new_func, dup_func, free_func) < 0)
+ return -1;
+ return (rsa_meth_num++);
}
int RSA_set_ex_data(RSA *r, int idx, void *arg)
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)
{
- ui_meth_num++;
- return(CRYPTO_get_ex_new_index(ui_meth_num-1,
- &ui_meth,argl,argp,new_func,dup_func,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++);
}
int UI_set_ex_data(UI *r, int idx, void *arg)
* That function uses locking, so we don't (usually)
* have to worry about locking here. For the whole cruel
* truth, see crypto/ex_data.c */
- x509_store_ctx_num++;
- return CRYPTO_get_ex_new_index(x509_store_ctx_num-1,
- &x509_store_ctx_method,
- argl,argp,new_func,dup_func,free_func);
+ if(CRYPTO_get_ex_new_index(x509_store_ctx_num, &x509_store_ctx_method,
+ argl, argp, new_func, dup_func, free_func) < 0)
+ return -1;
+ return (x509_store_ctx_num++);
}
int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data)
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)
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)
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)