diff options
author | Ulf Möller <ulf@openssl.org> | 1999-04-19 21:31:43 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-04-19 21:31:43 +0000 |
commit | 6b691a5c85ddc4e407e32781841fee5c029506cd (patch) | |
tree | 436f1127406e1cacfe83dfcbfff824d89c47d834 /crypto/rsa | |
parent | 3edd7ed15de229230f74c79c3d71e7c9c674cf4f (diff) | |
download | openssl-6b691a5c85ddc4e407e32781841fee5c029506cd.tar.gz |
Change functions to ANSI C.
Diffstat (limited to 'crypto/rsa')
-rw-r--r-- | crypto/rsa/rsa_eay.c | 45 | ||||
-rw-r--r-- | crypto/rsa/rsa_err.c | 2 | ||||
-rw-r--r-- | crypto/rsa/rsa_gen.c | 7 | ||||
-rw-r--r-- | crypto/rsa/rsa_lib.c | 76 | ||||
-rw-r--r-- | crypto/rsa/rsa_none.c | 15 | ||||
-rw-r--r-- | crypto/rsa/rsa_oaep.c | 20 | ||||
-rw-r--r-- | crypto/rsa/rsa_oaep_test.c | 2 | ||||
-rw-r--r-- | crypto/rsa/rsa_pk1.c | 30 | ||||
-rw-r--r-- | crypto/rsa/rsa_saos.c | 19 | ||||
-rw-r--r-- | crypto/rsa/rsa_sign.c | 18 | ||||
-rw-r--r-- | crypto/rsa/rsa_ssl.c | 15 |
11 files changed, 67 insertions, 182 deletions
diff --git a/crypto/rsa/rsa_eay.c b/crypto/rsa/rsa_eay.c index 609ec04a4c..c882738bf2 100644 --- a/crypto/rsa/rsa_eay.c +++ b/crypto/rsa/rsa_eay.c @@ -98,17 +98,13 @@ static RSA_METHOD rsa_pkcs1_eay_meth={ NULL, }; -RSA_METHOD *RSA_PKCS1_SSLeay() +RSA_METHOD *RSA_PKCS1_SSLeay(void) { return(&rsa_pkcs1_eay_meth); } -static int RSA_eay_public_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_public_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,j,k,num=0,r= -1; @@ -177,12 +173,8 @@ err: return(r); } -static int RSA_eay_private_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_private_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,j,k,num=0,r= -1; @@ -256,12 +248,8 @@ err: return(r); } -static int RSA_eay_private_decrypt(flen, from, to, rsa,padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_private_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int j,num=0,r= -1; @@ -350,12 +338,8 @@ err: return(r); } -static int RSA_eay_public_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +static int RSA_eay_public_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding) { BIGNUM f,ret; int i,num=0,r= -1; @@ -426,10 +410,7 @@ err: return(r); } -static int RSA_eay_mod_exp(r0, I, rsa) -BIGNUM *r0; -BIGNUM *I; -RSA *rsa; +static int RSA_eay_mod_exp(BIGNUM *r0, BIGNUM *I, RSA *rsa) { BIGNUM r1,m1; int ret=0; @@ -493,15 +474,13 @@ err: return(ret); } -static int RSA_eay_init(rsa) -RSA *rsa; +static int RSA_eay_init(RSA *rsa) { rsa->flags|=RSA_FLAG_CACHE_PUBLIC|RSA_FLAG_CACHE_PRIVATE; return(1); } -static int RSA_eay_finish(rsa) -RSA *rsa; +static int RSA_eay_finish(RSA *rsa) { if (rsa->_method_mod_n != NULL) BN_MONT_CTX_free(rsa->_method_mod_n); diff --git a/crypto/rsa/rsa_err.c b/crypto/rsa/rsa_err.c index cdb8a3334d..0d7e65670d 100644 --- a/crypto/rsa/rsa_err.c +++ b/crypto/rsa/rsa_err.c @@ -118,7 +118,7 @@ static ERR_STRING_DATA RSA_str_reasons[]= #endif -void ERR_load_RSA_strings() +void ERR_load_RSA_strings(void) { static int init=1; diff --git a/crypto/rsa/rsa_gen.c b/crypto/rsa/rsa_gen.c index 936db49515..b2569e508f 100644 --- a/crypto/rsa/rsa_gen.c +++ b/crypto/rsa/rsa_gen.c @@ -62,11 +62,8 @@ #include "bn.h" #include "rsa.h" -RSA *RSA_generate_key(bits, e_value, callback,cb_arg) -int bits; -unsigned long e_value; -void (*callback)(P_I_I_P); -char *cb_arg; +RSA *RSA_generate_key(int bits, unsigned long e_value, + void (*callback)(P_I_I_P), char *cb_arg) { RSA *rsa=NULL; BIGNUM *r0=NULL,*r1=NULL,*r2=NULL,*r3=NULL,*tmp; diff --git a/crypto/rsa/rsa_lib.c b/crypto/rsa/rsa_lib.c index 951d18185f..6732e9832f 100644 --- a/crypto/rsa/rsa_lib.c +++ b/crypto/rsa/rsa_lib.c @@ -69,19 +69,17 @@ static RSA_METHOD *default_RSA_meth=NULL; static int rsa_meth_num=0; static STACK *rsa_meth=NULL; -RSA *RSA_new() +RSA *RSA_new(void) { return(RSA_new_method(NULL)); } -void RSA_set_default_method(meth) -RSA_METHOD *meth; +void RSA_set_default_method(RSA_METHOD *meth) { default_RSA_meth=meth; } -RSA *RSA_new_method(meth) -RSA_METHOD *meth; +RSA *RSA_new_method(RSA_METHOD *meth) { RSA *ret; @@ -132,8 +130,7 @@ RSA_METHOD *meth; return(ret); } -void RSA_free(r) -RSA *r; +void RSA_free(RSA *r) { int i; @@ -170,87 +167,59 @@ RSA *r; Free(r); } -int RSA_get_ex_new_index(argl,argp,new_func,dup_func,free_func) -long argl; -char *argp; -int (*new_func)(); -int (*dup_func)(); -void (*free_func)(); +int RSA_get_ex_new_index(long argl, char *argp, int (*new_func)(), + int (*dup_func)(), void (*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(r,idx,arg) -RSA *r; -int idx; -char *arg; +int RSA_set_ex_data(RSA *r, int idx, char *arg) { return(CRYPTO_set_ex_data(&r->ex_data,idx,arg)); } -char *RSA_get_ex_data(r,idx) -RSA *r; -int idx; +char *RSA_get_ex_data(RSA *r, int idx) { return(CRYPTO_get_ex_data(&r->ex_data,idx)); } -int RSA_size(r) -RSA *r; +int RSA_size(RSA *r) { return(BN_num_bytes(r->n)); } -int RSA_public_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_public_encrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_pub_enc(flen, from, to, rsa, padding)); } -int RSA_private_encrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_private_encrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_priv_enc(flen, from, to, rsa, padding)); } -int RSA_private_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_private_decrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_priv_dec(flen, from, to, rsa, padding)); } -int RSA_public_decrypt(flen, from, to, rsa, padding) -int flen; -unsigned char *from; -unsigned char *to; -RSA *rsa; -int padding; +int RSA_public_decrypt(int flen, unsigned char *from, unsigned char *to, + RSA *rsa, int padding) { return(rsa->meth->rsa_pub_dec(flen, from, to, rsa, padding)); } -int RSA_flags(r) -RSA *r; +int RSA_flags(RSA *r) { return((r == NULL)?0:r->meth->flags); } -void RSA_blinding_off(rsa) -RSA *rsa; +void RSA_blinding_off(RSA *rsa) { if (rsa->blinding != NULL) { @@ -260,9 +229,7 @@ RSA *rsa; rsa->flags&= ~RSA_FLAG_BLINDING; } -int RSA_blinding_on(rsa,p_ctx) -RSA *rsa; -BN_CTX *p_ctx; +int RSA_blinding_on(RSA *rsa, BN_CTX *p_ctx) { BIGNUM *A,*Ai; BN_CTX *ctx; @@ -295,8 +262,7 @@ err: return(ret); } -int RSA_memory_lock(r) -RSA *r; +int RSA_memory_lock(RSA *r) { int i,j,k,off; char *p; diff --git a/crypto/rsa/rsa_none.c b/crypto/rsa/rsa_none.c index e944f84bec..6d43677a15 100644 --- a/crypto/rsa/rsa_none.c +++ b/crypto/rsa/rsa_none.c @@ -62,11 +62,8 @@ #include "rsa.h" #include "rand.h" -int RSA_padding_add_none(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_none(unsigned char *to, int tlen, unsigned char *from, + int flen) { if (flen > tlen) { @@ -84,12 +81,8 @@ int flen; return(1); } -int RSA_padding_check_none(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_none(unsigned char *to, int tlen, unsigned char *from, + int flen, int num) { if (flen > tlen) diff --git a/crypto/rsa/rsa_oaep.c b/crypto/rsa/rsa_oaep.c index 6907ba9969..44732460b3 100644 --- a/crypto/rsa/rsa_oaep.c +++ b/crypto/rsa/rsa_oaep.c @@ -13,13 +13,8 @@ int MGF1(unsigned char *mask, long len, unsigned char *seed, long seedlen); -int RSA_padding_add_PKCS1_OAEP(to, tlen, from, flen, param, plen) - unsigned char *to; - int tlen; - unsigned char *from; - int flen; - unsigned char *param; - int plen; +int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, + unsigned char *from, int flen, unsigned char *param, int plen) { int i, emlen = tlen - 1; unsigned char *db, *seed; @@ -73,14 +68,9 @@ int RSA_padding_add_PKCS1_OAEP(to, tlen, from, flen, param, plen) return (1); } -int RSA_padding_check_PKCS1_OAEP(to, tlen, from, flen, num, param, plen) - unsigned char *to; - int tlen; - unsigned char *from; - int flen; - int num; - unsigned char *param; - int plen; +int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, + unsigned char *from, int flen, int num, unsigned char *param, + int plen) { int i, dblen, mlen = -1; unsigned char *maskeddb; diff --git a/crypto/rsa/rsa_oaep_test.c b/crypto/rsa/rsa_oaep_test.c index c18fd98b3a..c4b454a71a 100644 --- a/crypto/rsa/rsa_oaep_test.c +++ b/crypto/rsa/rsa_oaep_test.c @@ -184,7 +184,7 @@ int key3(RSA *key, unsigned char *c) SetKey; } -int pad_unknown() +int pad_unknown(void) { unsigned long l; while ((l = ERR_get_error()) != 0) diff --git a/crypto/rsa/rsa_pk1.c b/crypto/rsa/rsa_pk1.c index 4638187970..7648b763a9 100644 --- a/crypto/rsa/rsa_pk1.c +++ b/crypto/rsa/rsa_pk1.c @@ -74,11 +74,8 @@ int RSA_padding_check_none(); #endif -int RSA_padding_add_PKCS1_type_1(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, + unsigned char *from, int flen) { int j; unsigned char *p; @@ -103,12 +100,8 @@ int flen; return(1); } -int RSA_padding_check_PKCS1_type_1(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, + unsigned char *from, int flen, int num) { int i,j; unsigned char *p; @@ -154,11 +147,8 @@ int num; return(j); } -int RSA_padding_add_PKCS1_type_2(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, + unsigned char *from, int flen) { int i,j; unsigned char *p; @@ -193,12 +183,8 @@ int flen; return(1); } -int RSA_padding_check_PKCS1_type_2(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, + unsigned char *from, int flen, int num) { int i,j; unsigned char *p; diff --git a/crypto/rsa/rsa_saos.c b/crypto/rsa/rsa_saos.c index fb0fae5a43..d73beb0491 100644 --- a/crypto/rsa/rsa_saos.c +++ b/crypto/rsa/rsa_saos.c @@ -63,13 +63,8 @@ #include "objects.h" #include "x509.h" -int RSA_sign_ASN1_OCTET_STRING(type,m,m_len,sigret,siglen,rsa) -int type; -unsigned char *m; -unsigned int m_len; -unsigned char *sigret; -unsigned int *siglen; -RSA *rsa; +int RSA_sign_ASN1_OCTET_STRING(int type, unsigned char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) { ASN1_OCTET_STRING sig; int i,j,ret=1; @@ -105,13 +100,9 @@ RSA *rsa; return(ret); } -int RSA_verify_ASN1_OCTET_STRING(dtype, m, m_len, sigbuf, siglen, rsa) -int dtype; -unsigned char *m; -unsigned int m_len; -unsigned char *sigbuf; -unsigned int siglen; -RSA *rsa; +int RSA_verify_ASN1_OCTET_STRING(int dtype, unsigned char *m, + unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, + RSA *rsa) { int i,ret=0; unsigned char *p,*s; diff --git a/crypto/rsa/rsa_sign.c b/crypto/rsa/rsa_sign.c index e38911146a..31cdb4a81a 100644 --- a/crypto/rsa/rsa_sign.c +++ b/crypto/rsa/rsa_sign.c @@ -63,13 +63,8 @@ #include "objects.h" #include "x509.h" -int RSA_sign(type,m,m_len,sigret,siglen,rsa) -int type; -unsigned char *m; -unsigned int m_len; -unsigned char *sigret; -unsigned int *siglen; -RSA *rsa; +int RSA_sign(int type, unsigned char *m, unsigned int m_len, + unsigned char *sigret, unsigned int *siglen, RSA *rsa) { X509_SIG sig; ASN1_TYPE parameter; @@ -124,13 +119,8 @@ RSA *rsa; return(ret); } -int RSA_verify(dtype, m, m_len, sigbuf, siglen, rsa) -int dtype; -unsigned char *m; -unsigned int m_len; -unsigned char *sigbuf; -unsigned int siglen; -RSA *rsa; +int RSA_verify(int dtype, unsigned char *m, unsigned int m_len, + unsigned char *sigbuf, unsigned int siglen, RSA *rsa) { int i,ret=0,sigtype; unsigned char *p,*s; diff --git a/crypto/rsa/rsa_ssl.c b/crypto/rsa/rsa_ssl.c index 42ee076800..e1bbbe7949 100644 --- a/crypto/rsa/rsa_ssl.c +++ b/crypto/rsa/rsa_ssl.c @@ -62,11 +62,8 @@ #include "rsa.h" #include "rand.h" -int RSA_padding_add_SSLv23(to,tlen,from,flen) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; +int RSA_padding_add_SSLv23(unsigned char *to, int tlen, unsigned char *from, + int flen) { int i,j; unsigned char *p; @@ -103,12 +100,8 @@ int flen; return(1); } -int RSA_padding_check_SSLv23(to,tlen,from,flen,num) -unsigned char *to; -int tlen; -unsigned char *from; -int flen; -int num; +int RSA_padding_check_SSLv23(unsigned char *to, int tlen, unsigned char *from, + int flen, int num) { int i,j,k; unsigned char *p; |