From 796d609550df3a33fc11468741c5d2f6d3df4c11 Mon Sep 17 00:00:00 2001 From: beck <> Date: Sun, 19 Mar 2000 11:13:58 +0000 Subject: OpenSSL 0.9.5 merge *warning* this bumps shared lib minors for libssl and libcrypto from 2.1 to 2.2 if you are using the ssl26 packages for ssh and other things to work you will need to get new ones (see ~beck/libsslsnap/) on cvs or ~beck/src-patent.tar.gz on cvs --- src/lib/libcrypto/rsa/rsa_lib.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/lib/libcrypto/rsa/rsa_lib.c') diff --git a/src/lib/libcrypto/rsa/rsa_lib.c b/src/lib/libcrypto/rsa/rsa_lib.c index c0ca2923a6..074a4f5074 100644 --- a/src/lib/libcrypto/rsa/rsa_lib.c +++ b/src/lib/libcrypto/rsa/rsa_lib.c @@ -67,7 +67,7 @@ const char *RSA_version="RSA" OPENSSL_VERSION_PTEXT; static RSA_METHOD *default_RSA_meth=NULL; static int rsa_meth_num=0; -static STACK *rsa_meth=NULL; +static STACK_OF(CRYPTO_EX_DATA_FUNCS) *rsa_meth=NULL; RSA *RSA_new(void) { @@ -105,10 +105,14 @@ RSA *RSA_new_method(RSA_METHOD *meth) if (default_RSA_meth == NULL) { +#ifdef RSA_NULL + default_RSA_meth=RSA_null_method(); +#else #ifdef RSAref default_RSA_meth=RSA_PKCS1_RSAref(); #else default_RSA_meth=RSA_PKCS1_SSLeay(); +#endif #endif } ret=(RSA *)Malloc(sizeof(RSA)); @@ -146,7 +150,7 @@ RSA *RSA_new_method(RSA_METHOD *meth) ret=NULL; } else - CRYPTO_new_ex_data(rsa_meth,(char *)ret,&ret->ex_data); + CRYPTO_new_ex_data(rsa_meth,ret,&ret->ex_data); return(ret); } @@ -169,7 +173,7 @@ void RSA_free(RSA *r) } #endif - CRYPTO_free_ex_data(rsa_meth,(char *)r,&r->ex_data); + CRYPTO_free_ex_data(rsa_meth,r,&r->ex_data); if (r->meth->finish != NULL) r->meth->finish(r); @@ -187,20 +191,20 @@ void RSA_free(RSA *r) Free(r); } -int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), - int (*dup_func)(), void (*free_func)()) +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)); } -int RSA_set_ex_data(RSA *r, int idx, char *arg) +int RSA_set_ex_data(RSA *r, int idx, void *arg) { return(CRYPTO_set_ex_data(&r->ex_data,idx,arg)); } -char *RSA_get_ex_data(RSA *r, int idx) +void *RSA_get_ex_data(RSA *r, int idx) { return(CRYPTO_get_ex_data(&r->ex_data,idx)); } @@ -265,19 +269,19 @@ int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx) if (rsa->blinding != NULL) BN_BLINDING_free(rsa->blinding); - A= &(ctx->bn[0]); - ctx->tos++; + BN_CTX_start(ctx); + A = BN_CTX_get(ctx); if (!BN_rand(A,BN_num_bits(rsa->n)-1,1,0)) goto err; if ((Ai=BN_mod_inverse(NULL,A,rsa->n,ctx)) == NULL) goto err; if (!rsa->meth->bn_mod_exp(A,A,rsa->e,rsa->n,ctx,rsa->_method_mod_n)) goto err; rsa->blinding=BN_BLINDING_new(A,Ai,rsa->n); - ctx->tos--; rsa->flags|=RSA_FLAG_BLINDING; BN_free(Ai); ret=1; err: + BN_CTX_end(ctx); if (ctx != p_ctx) BN_CTX_free(ctx); return(ret); } -- cgit v1.2.3-55-g6feb