From eaff5a1412011574860a74ff9076838ea1e59dd0 Mon Sep 17 00:00:00 2001 From: "Dr. Stephen Henson" Date: Wed, 24 May 2006 12:33:46 +0000 Subject: [PATCH] Use size_t for new crypto size parameters. --- crypto/dh/dh_pmeth.c | 2 +- crypto/dsa/dsa_pmeth.c | 8 ++++---- crypto/ec/ec_pmeth.c | 14 ++++++------- crypto/evp/evp.h | 46 +++++++++++++++++++++--------------------- crypto/evp/evp_locl.h | 25 ++++++++++++----------- crypto/evp/pmeth_fn.c | 24 +++++++++++----------- crypto/evp/pmeth_lib.c | 24 +++++++++++----------- crypto/rsa/rsa_pmeth.c | 32 +++++++++++++++-------------- 8 files changed, 89 insertions(+), 86 deletions(-) diff --git a/crypto/dh/dh_pmeth.c b/crypto/dh/dh_pmeth.c index a4b7341c22..b8b1362eba 100644 --- a/crypto/dh/dh_pmeth.c +++ b/crypto/dh/dh_pmeth.c @@ -187,7 +187,7 @@ static int pkey_dh_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) return DH_generate_key(pkey->pkey.dh); } -static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen) +static int pkey_dh_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { int ret; if (!ctx->pkey || !ctx->peerkey) diff --git a/crypto/dsa/dsa_pmeth.c b/crypto/dsa/dsa_pmeth.c index 711a68f6bd..9909dc8f3b 100644 --- a/crypto/dsa/dsa_pmeth.c +++ b/crypto/dsa/dsa_pmeth.c @@ -98,8 +98,8 @@ static void pkey_dsa_cleanup(EVP_PKEY_CTX *ctx) OPENSSL_free(dctx); } -static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen) +static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen) { int ret, type; unsigned int sltmp; @@ -120,8 +120,8 @@ static int pkey_dsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, } static int pkey_dsa_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen) + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen) { int ret, type; DSA_PKEY_CTX *dctx = ctx->data; diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c index f6a027ef6c..760200892e 100644 --- a/crypto/ec/ec_pmeth.c +++ b/crypto/ec/ec_pmeth.c @@ -99,11 +99,11 @@ static void pkey_ec_cleanup(EVP_PKEY_CTX *ctx) } } -static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen) +static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen) { int ret, type; - unsigned int sltmp; + size_t sltmp; EC_PKEY_CTX *dctx = ctx->data; EC_KEY *ec = ctx->pkey->pkey.ec; @@ -112,7 +112,7 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, *siglen = ECDSA_size(ec); return 1; } - else if(*siglen < ECDSA_size(ec)) + else if(*siglen < (size_t)ECDSA_size(ec)) { ECerr(EC_F_PKEY_EC_SIGN, EC_R_BUFFER_TOO_SMALL); return 0; @@ -133,8 +133,8 @@ static int pkey_ec_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, } static int pkey_ec_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen) + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen) { int ret, type; EC_PKEY_CTX *dctx = ctx->data; @@ -150,7 +150,7 @@ static int pkey_ec_verify(EVP_PKEY_CTX *ctx, return ret; } -static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen) +static int pkey_ec_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen) { int ret; size_t outlen; diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index e5af71669b..d76d135abf 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -964,28 +964,28 @@ void *EVP_PKEY_CTX_get_app_data(EVP_PKEY_CTX *ctx); int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, - unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen); + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen); int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen); + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen); int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, - unsigned char *rout, int *routlen, - const unsigned char *sig, int siglen); + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen); int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, int *outlen, - const unsigned char *in, int inlen); + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, int *outlen, - const unsigned char *in, int inlen); + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); int EVP_PKEY_derive_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer); -int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen); +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); typedef int EVP_PKEY_gen_cb(EVP_PKEY_CTX *ctx); @@ -1013,23 +1013,23 @@ void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, int (*sign_init)(EVP_PKEY_CTX *ctx), - int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen)); + int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, int (*verify_init)(EVP_PKEY_CTX *ctx), - int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen)); + int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)); void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, int (*verify_recover_init)(EVP_PKEY_CTX *ctx), int (*verify_recover)(EVP_PKEY_CTX *ctx, - unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen)); + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)); void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), - int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, + int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, EVP_MD_CTX *mctx)); void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, @@ -1039,17 +1039,17 @@ void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, int (*encrypt_init)(EVP_PKEY_CTX *ctx), - int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen)); + int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, int (*decrypt_init)(EVP_PKEY_CTX *ctx), - int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen)); + int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)); void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, int (*derive_init)(EVP_PKEY_CTX *ctx), - int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen)); + int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)); void EVP_PKEY_meth_set_ctrl(EVP_PKEY_METHOD *pmeth, int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2), diff --git a/crypto/evp/evp_locl.h b/crypto/evp/evp_locl.h index 570ac97ae9..c8a12e2fa5 100644 --- a/crypto/evp/evp_locl.h +++ b/crypto/evp/evp_locl.h @@ -273,20 +273,21 @@ struct evp_pkey_method_st int (*keygen)(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey); int (*sign_init)(EVP_PKEY_CTX *ctx); - int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen); + int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen); int (*verify_init)(EVP_PKEY_CTX *ctx); - int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen); + int (*verify)(EVP_PKEY_CTX *ctx, + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen); int (*verify_recover_init)(EVP_PKEY_CTX *ctx); int (*verify_recover)(EVP_PKEY_CTX *ctx, - unsigned char *rout, int *routlen, - const unsigned char *sig, int siglen); + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen); int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); - int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, + int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, EVP_MD_CTX *mctx); int (*verifyctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx); @@ -294,15 +295,15 @@ struct evp_pkey_method_st EVP_MD_CTX *mctx); int (*encrypt_init)(EVP_PKEY_CTX *ctx); - int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen); + int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); int (*decrypt_init)(EVP_PKEY_CTX *ctx); - int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen); + int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); int (*derive_init)(EVP_PKEY_CTX *ctx); - int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen); + int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen); int (*ctrl)(EVP_PKEY_CTX *ctx, int type, int p1, void *p2); int (*ctrl_str)(EVP_PKEY_CTX *ctx, const char *type, const char *value); diff --git a/crypto/evp/pmeth_fn.c b/crypto/evp/pmeth_fn.c index dbd639bef2..5e08cedd14 100644 --- a/crypto/evp/pmeth_fn.c +++ b/crypto/evp/pmeth_fn.c @@ -66,7 +66,7 @@ #define M_check_autoarg(ctx, arg, arglen, err) \ if (ctx->pmeth->flags & EVP_PKEY_FLAG_AUTOARGLEN) \ { \ - int pksize = EVP_PKEY_size(ctx->pkey); \ + size_t pksize = (size_t)EVP_PKEY_size(ctx->pkey); \ if (!arg) \ { \ *arglen = pksize; \ @@ -98,8 +98,8 @@ int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, - unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen) + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->sign) { @@ -135,8 +135,8 @@ int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen) + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->verify) { @@ -171,8 +171,8 @@ int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, - unsigned char *rout, int *routlen, - const unsigned char *sig, int siglen) + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->verify_recover) { @@ -208,8 +208,8 @@ int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, int *outlen, - const unsigned char *in, int inlen) + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->encrypt) { @@ -245,8 +245,8 @@ int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx) } int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, int *outlen, - const unsigned char *in, int inlen) + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->decrypt) { @@ -342,7 +342,7 @@ int EVP_PKEY_derive_set_peer(EVP_PKEY_CTX *ctx, EVP_PKEY *peer) } -int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, int *pkeylen) +int EVP_PKEY_derive(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *pkeylen) { if (!ctx || !ctx->pmeth || !ctx->pmeth->derive) { diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 4b69593ee7..6db6b17899 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -329,8 +329,8 @@ void EVP_PKEY_meth_set_keygen(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, int (*sign_init)(EVP_PKEY_CTX *ctx), - int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen)) + int (*sign)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)) { pmeth->sign_init = sign_init; pmeth->sign = sign; @@ -338,8 +338,8 @@ void EVP_PKEY_meth_set_sign(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, int (*verify_init)(EVP_PKEY_CTX *ctx), - int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen)) + int (*verify)(EVP_PKEY_CTX *ctx, const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen)) { pmeth->verify_init = verify_init; pmeth->verify = verify; @@ -348,8 +348,8 @@ void EVP_PKEY_meth_set_verify(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, int (*verify_recover_init)(EVP_PKEY_CTX *ctx), int (*verify_recover)(EVP_PKEY_CTX *ctx, - unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen)) + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen)) { pmeth->verify_recover_init = verify_recover_init; pmeth->verify_recover = verify_recover; @@ -357,7 +357,7 @@ void EVP_PKEY_meth_set_verify_recover(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_signctx(EVP_PKEY_METHOD *pmeth, int (*signctx_init)(EVP_PKEY_CTX *ctx, EVP_MD_CTX *mctx), - int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, + int (*signctx)(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, EVP_MD_CTX *mctx)) { pmeth->signctx_init = signctx_init; @@ -375,8 +375,8 @@ void EVP_PKEY_meth_set_verifyctx(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, int (*encrypt_init)(EVP_PKEY_CTX *ctx), - int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen)) + int (*encrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)) { pmeth->encrypt_init = encrypt_init; pmeth->encrypt = encrypt; @@ -384,8 +384,8 @@ void EVP_PKEY_meth_set_encrypt(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, int (*decrypt_init)(EVP_PKEY_CTX *ctx), - int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen)) + int (*decrypt)(EVP_PKEY_CTX *ctx, unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen)) { pmeth->decrypt_init = decrypt_init; pmeth->decrypt = decrypt; @@ -393,7 +393,7 @@ void EVP_PKEY_meth_set_decrypt(EVP_PKEY_METHOD *pmeth, void EVP_PKEY_meth_set_derive(EVP_PKEY_METHOD *pmeth, int (*derive_init)(EVP_PKEY_CTX *ctx), - int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, int *keylen)) + int (*derive)(EVP_PKEY_CTX *ctx, unsigned char *key, size_t *keylen)) { pmeth->derive_init = derive_init; pmeth->derive = derive; diff --git a/crypto/rsa/rsa_pmeth.c b/crypto/rsa/rsa_pmeth.c index 3788406bb8..168a33ee56 100644 --- a/crypto/rsa/rsa_pmeth.c +++ b/crypto/rsa/rsa_pmeth.c @@ -64,9 +64,9 @@ #include #include "evp_locl.h" -extern int int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, - unsigned char *rm, unsigned int *prm_len, - const unsigned char *sigbuf, unsigned int siglen, +extern int int_rsa_verify(int dtype, const unsigned char *m, size_t m_len, + unsigned char *rm, size_t *prm_len, + const unsigned char *sigbuf, size_t siglen, RSA *rsa); /* RSA pkey context structure */ @@ -132,8 +132,8 @@ static void pkey_rsa_cleanup(EVP_PKEY_CTX *ctx) } } -static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, - const unsigned char *tbs, int tbslen) +static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -141,7 +141,7 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, if (rctx->md) { - if (tbslen != EVP_MD_size(rctx->md)) + if (tbslen != (size_t)EVP_MD_size(rctx->md)) { RSAerr(RSA_F_PKEY_RSA_SIGN, RSA_R_INVALID_DIGEST_LENGTH); @@ -190,8 +190,8 @@ static int pkey_rsa_sign(EVP_PKEY_CTX *ctx, unsigned char *sig, int *siglen, static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx, - unsigned char *rout, int *routlen, - const unsigned char *sig, int siglen) + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -245,12 +245,12 @@ static int pkey_rsa_verifyrecover(EVP_PKEY_CTX *ctx, } static int pkey_rsa_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, int siglen, - const unsigned char *tbs, int tbslen) + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen) { RSA_PKEY_CTX *rctx = ctx->data; RSA *rsa = ctx->pkey->pkey.rsa; - int rslen; + size_t rslen; if (rctx->md) { if (rctx->pad_mode == RSA_PKCS1_PADDING) @@ -298,8 +298,9 @@ static int pkey_rsa_verify(EVP_PKEY_CTX *ctx, } -static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen) +static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; @@ -311,8 +312,9 @@ static int pkey_rsa_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, return 1; } -static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx, unsigned char *out, int *outlen, - const unsigned char *in, int inlen) +static int pkey_rsa_decrypt(EVP_PKEY_CTX *ctx, + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen) { int ret; RSA_PKEY_CTX *rctx = ctx->data; -- 2.25.1