diff options
author | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2008-11-12 03:58:08 +0000 |
commit | 6343829a391df59e46e513c84b6264ee71ad9518 (patch) | |
tree | 9823103bf5828e47081ac906203516bdc332f577 /crypto/evp | |
parent | 2401debe83e8df930907a39065ebf9a54354f123 (diff) |
Revert the size_t modifications from HEAD that had led to more
knock-on work than expected - they've been extracted into a patch
series that can be completed elsewhere, or in a different branch,
before merging back to HEAD.
Diffstat (limited to 'crypto/evp')
-rw-r--r-- | crypto/evp/e_des3.c | 6 | ||||
-rw-r--r-- | crypto/evp/encode.c | 15 | ||||
-rw-r--r-- | crypto/evp/evp.h | 109 | ||||
-rw-r--r-- | crypto/evp/evp_enc.c | 17 | ||||
-rw-r--r-- | crypto/evp/evp_key.c | 2 | ||||
-rw-r--r-- | crypto/evp/evp_lib.c | 19 | ||||
-rw-r--r-- | crypto/evp/p_open.c | 4 | ||||
-rw-r--r-- | crypto/evp/p_verify.c | 4 |
8 files changed, 86 insertions, 90 deletions
diff --git a/crypto/evp/e_des3.c b/crypto/evp/e_des3.c index 03ef84cc43..059ad77118 100644 --- a/crypto/evp/e_des3.c +++ b/crypto/evp/e_des3.c @@ -122,8 +122,8 @@ static int des_ede_cbc_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, #ifdef KSSL_DEBUG { int i; - printf("des_ede_cbc_cipher(ctx=%lx, buflen=%ld)\n", (unsigned long)ctx, - (unsigned long)ctx->buf_len); + char *cp; + printf("des_ede_cbc_cipher(ctx=%lx, buflen=%d)\n", ctx, ctx->buf_len); printf("\t iv= "); for(i=0;i<8;i++) printf("%02X",ctx->iv[i]); @@ -257,7 +257,7 @@ static int des_ede3_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, #ifdef KSSL_DEBUG { int i; - printf("des_ede3_init_key(ctx=%lx)\n", (unsigned long)ctx); + printf("des_ede3_init_key(ctx=%lx)\n", ctx); printf("\tKEY= "); for(i=0;i<24;i++) printf("%02X",key[i]); printf("\n"); printf("\t IV= "); diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c index 77a64437ef..b42c747249 100644 --- a/crypto/evp/encode.c +++ b/crypto/evp/encode.c @@ -129,14 +129,14 @@ void EVP_EncodeInit(EVP_ENCODE_CTX *ctx) } void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl) + const unsigned char *in, int inl) { - size_t i,j; + int i,j; unsigned int total=0; *outl=0; if (inl == 0) return; - OPENSSL_assert(ctx->length <= sizeof(ctx->enc_data)); + OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data)); if ((ctx->num+inl) < ctx->length) { memcpy(&(ctx->enc_data[ctx->num]),in,inl); @@ -186,7 +186,7 @@ void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) *outl=ret; } -int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, size_t dlen) +int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int dlen) { int i,ret=0; unsigned long l; @@ -233,10 +233,9 @@ void EVP_DecodeInit(EVP_ENCODE_CTX *ctx) * 1 for full line */ int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl) + const unsigned char *in, int inl) { - int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,ln,tmp2,exp_nl; - size_t n; + int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl; unsigned char *d; n=ctx->num; @@ -357,7 +356,7 @@ end: return(rv); } -int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, size_t n) +int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n) { int i,ret=0,a,b,c,d; unsigned long l; diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h index 7c191943bd..985ff2f5a9 100644 --- a/crypto/evp/evp.h +++ b/crypto/evp/evp.h @@ -160,7 +160,7 @@ struct env_md_st { int type; int pkey_type; - size_t md_size; + int md_size; unsigned long flags; int (*init)(EVP_MD_CTX *ctx); int (*update)(EVP_MD_CTX *ctx,const void *data,size_t count); @@ -175,8 +175,8 @@ struct env_md_st const unsigned char *sigbuf, unsigned int siglen, void *key); int required_pkey_type[5]; /*EVP_PKEY_xxx */ - size_t block_size; - size_t ctx_size; /* how big does the ctx->md_data need to be */ + int block_size; + int ctx_size; /* how big does the ctx->md_data need to be */ /* control function */ int (*md_ctrl)(EVP_MD_CTX *ctx, int cmd, int p1, void *p2); } /* EVP_MD */; @@ -292,16 +292,16 @@ struct env_md_ctx_st struct evp_cipher_st { int nid; - size_t block_size; - size_t key_len; /* Default value for variable length ciphers */ - size_t iv_len; + int block_size; + int key_len; /* Default value for variable length ciphers */ + int iv_len; unsigned long flags; /* Various flags */ int (*init)(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc); /* init key */ int (*do_cipher)(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, size_t inl);/* encrypt/decrypt data */ int (*cleanup)(EVP_CIPHER_CTX *); /* cleanup ctx */ - size_t ctx_size; /* how big ctx->cipher_data needs to be */ + int ctx_size; /* how big ctx->cipher_data needs to be */ int (*set_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Populate a ASN1_TYPE with parameters */ int (*get_asn1_parameters)(EVP_CIPHER_CTX *, ASN1_TYPE *); /* Get parameters from a ASN1_TYPE */ int (*ctrl)(EVP_CIPHER_CTX *, int type, int arg, void *ptr); /* Miscellaneous operations */ @@ -355,7 +355,7 @@ struct evp_cipher_ctx_st const EVP_CIPHER *cipher; ENGINE *engine; /* functional reference if 'cipher' is ENGINE-provided */ int encrypt; /* encrypt or decrypt */ - size_t buf_len; /* number we have left */ + int buf_len; /* number we have left */ unsigned char oiv[EVP_MAX_IV_LENGTH]; /* original iv */ unsigned char iv[EVP_MAX_IV_LENGTH]; /* working iv */ @@ -363,18 +363,18 @@ struct evp_cipher_ctx_st int num; /* used by cfb/ofb mode */ void *app_data; /* application stuff */ - size_t key_len; /* May change for variable length cipher */ + int key_len; /* May change for variable length cipher */ unsigned long flags; /* Various flags */ void *cipher_data; /* per EVP data */ - size_t final_used; + int final_used; int block_mask; unsigned char final[EVP_MAX_BLOCK_LENGTH];/* possible final block */ } /* EVP_CIPHER_CTX */; typedef struct evp_Encode_Ctx_st { - size_t num; /* number saved in a partial encode/decode */ - size_t length; /* The length is either the output line length + int num; /* number saved in a partial encode/decode */ + int length; /* The length is either the output line length * (in input bytes) or the shortest input line * length that is ok. Once decoding begins, * the length is adjusted up each time a longer @@ -419,8 +419,8 @@ int EVP_MD_type(const EVP_MD *md); #define EVP_MD_nid(e) EVP_MD_type(e) #define EVP_MD_name(e) OBJ_nid2sn(EVP_MD_nid(e)) int EVP_MD_pkey_type(const EVP_MD *md); -size_t EVP_MD_size(const EVP_MD *md); -size_t EVP_MD_block_size(const EVP_MD *md); +int EVP_MD_size(const EVP_MD *md); +int EVP_MD_block_size(const EVP_MD *md); const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) @@ -429,17 +429,17 @@ const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); int EVP_CIPHER_nid(const EVP_CIPHER *cipher); #define EVP_CIPHER_name(e) OBJ_nid2sn(EVP_CIPHER_nid(e)) -size_t EVP_CIPHER_block_size(const EVP_CIPHER *cipher); -size_t EVP_CIPHER_key_length(const EVP_CIPHER *cipher); -size_t EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); +int EVP_CIPHER_block_size(const EVP_CIPHER *cipher); +int EVP_CIPHER_key_length(const EVP_CIPHER *cipher); +int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher); unsigned long EVP_CIPHER_flags(const EVP_CIPHER *cipher); #define EVP_CIPHER_mode(e) (EVP_CIPHER_flags(e) & EVP_CIPH_MODE) const EVP_CIPHER * EVP_CIPHER_CTX_cipher(const EVP_CIPHER_CTX *ctx); int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx); -size_t EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); -size_t EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); -size_t EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx); +int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx); void * EVP_CIPHER_CTX_get_app_data(const EVP_CIPHER_CTX *ctx); void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data); #define EVP_CIPHER_CTX_type(c) EVP_CIPHER_type(EVP_CIPHER_CTX_cipher(c)) @@ -471,8 +471,10 @@ void BIO_set_md(BIO *,const EVP_MD *md); #define BIO_get_cipher_status(b) BIO_ctrl(b,BIO_C_GET_CIPHER_STATUS,0,NULL) #define BIO_get_cipher_ctx(b,c_pp) BIO_ctrl(b,BIO_C_GET_CIPHER_CTX,0,(char *)c_pp) -size_t EVP_Cipher(EVP_CIPHER_CTX *c, unsigned char *out, - const unsigned char *in, size_t inl); +int EVP_Cipher(EVP_CIPHER_CTX *c, + unsigned char *out, + const unsigned char *in, + unsigned int inl); #define EVP_add_cipher_alias(n,alias) \ OBJ_NAME_add((alias),OBJ_NAME_TYPE_CIPHER_METH|OBJ_NAME_ALIAS,(n)) @@ -508,27 +510,25 @@ char * EVP_get_pw_prompt(void); int EVP_BytesToKey(const EVP_CIPHER *type,const EVP_MD *md, const unsigned char *salt, const unsigned char *data, - size_t datal, int count, unsigned char *key,unsigned char *iv); + int datal, int count, unsigned char *key,unsigned char *iv); int EVP_EncryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, const unsigned char *key, const unsigned char *iv); int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, const unsigned char *key, const unsigned char *iv); int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, size_t inl); + int *outl, const unsigned char *in, int inl); int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); int EVP_DecryptInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, - const unsigned char *key, const unsigned char *iv); -int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, - ENGINE *impl, const unsigned char *key, - const unsigned char *iv); + const unsigned char *key, const unsigned char *iv); +int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl, + const unsigned char *key, const unsigned char *iv); int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, size_t inl); + int *outl, const unsigned char *in, int inl); int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); -int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, - int *outl); +int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CipherInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, const unsigned char *key,const unsigned char *iv, @@ -537,53 +537,54 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *cipher, ENGINE *impl const unsigned char *key,const unsigned char *iv, int enc); int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, const unsigned char *in, size_t inl); + int *outl, const unsigned char *in, int inl); int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_SignFinal(EVP_MD_CTX *ctx,unsigned char *md,unsigned int *s, - EVP_PKEY *pkey); + EVP_PKEY *pkey); int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf, - size_t siglen,EVP_PKEY *pkey); + unsigned int siglen,EVP_PKEY *pkey); int EVP_DigestSignInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); int EVP_DigestSignFinal(EVP_MD_CTX *ctx, - unsigned char *sigret, size_t *siglen); + unsigned char *sigret, size_t *siglen); int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, - unsigned char *sig, size_t siglen); + unsigned char *sig, size_t siglen); int EVP_OpenInit(EVP_CIPHER_CTX *ctx,const EVP_CIPHER *type, - const unsigned char *ek, size_t ekl, - const unsigned char *iv, EVP_PKEY *priv); + const unsigned char *ek, int ekl, const unsigned char *iv, + EVP_PKEY *priv); int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char **ek, int *ekl, unsigned char *iv, - EVP_PKEY **pubk, int npubk); -int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); + unsigned char **ek, int *ekl, unsigned char *iv, + EVP_PKEY **pubk, int npubk); +int EVP_SealFinal(EVP_CIPHER_CTX *ctx,unsigned char *out,int *outl); void EVP_EncodeInit(EVP_ENCODE_CTX *ctx); -void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl); -void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); -int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, size_t n); +void EVP_EncodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, + const unsigned char *in,int inl); +void EVP_EncodeFinal(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl); +int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, int n); void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx,unsigned char *out,int *outl, - const unsigned char *in, size_t inl); -int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); -int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, size_t n); + const unsigned char *in, int inl); +int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned + char *out, int *outl); +int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); void EVP_CIPHER_CTX_init(EVP_CIPHER_CTX *a); int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *a); EVP_CIPHER_CTX *EVP_CIPHER_CTX_new(void); void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *a); -int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, size_t keylen); +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *c, int pad); int EVP_CIPHER_CTX_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, void *ptr); int EVP_CIPHER_CTX_rand_key(EVP_CIPHER_CTX *ctx, unsigned char *key); @@ -849,13 +850,13 @@ EVP_PKEY * EVP_PKEY_new(void); void EVP_PKEY_free(EVP_PKEY *pkey); EVP_PKEY * d2i_PublicKey(int type,EVP_PKEY **a, const unsigned char **pp, - size_t length); + long length); int i2d_PublicKey(EVP_PKEY *a, unsigned char **pp); EVP_PKEY * d2i_PrivateKey(int type,EVP_PKEY **a, const unsigned char **pp, long length); EVP_PKEY * d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, - size_t length); + long length); int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from); @@ -961,13 +962,13 @@ void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth, ASN1_PCTX *pctx)); void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth, int (*param_decode)(EVP_PKEY *pkey, - const unsigned char **pder, size_t derlen), + const unsigned char **pder, int derlen), int (*param_encode)(const EVP_PKEY *pkey, unsigned char **pder), int (*param_missing)(const EVP_PKEY *pk), int (*param_copy)(EVP_PKEY *to, const EVP_PKEY *from), int (*param_cmp)(const EVP_PKEY *a, const EVP_PKEY *b), int (*param_print)(BIO *out, const EVP_PKEY *pkey, int indent, - ASN1_PCTX *pctx)); + ASN1_PCTX *pctx)); void EVP_PKEY_asn1_set_free(EVP_PKEY_ASN1_METHOD *ameth, void (*pkey_free)(EVP_PKEY *pkey)); diff --git a/crypto/evp/evp_enc.c b/crypto/evp/evp_enc.c index 586756bfd1..6e582c458d 100644 --- a/crypto/evp/evp_enc.c +++ b/crypto/evp/evp_enc.c @@ -209,8 +209,7 @@ skip_to_init: OPENSSL_assert(EVP_CIPHER_CTX_iv_length(ctx) <= (int)sizeof(ctx->iv)); - if(iv) memcpy(ctx->oiv, iv, - EVP_CIPHER_CTX_iv_length(ctx)); + if(iv) memcpy(ctx->oiv, iv, EVP_CIPHER_CTX_iv_length(ctx)); memcpy(ctx->iv, ctx->oiv, EVP_CIPHER_CTX_iv_length(ctx)); break; @@ -230,7 +229,7 @@ skip_to_init: } int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl) + const unsigned char *in, int inl) { if (ctx->encrypt) return EVP_EncryptUpdate(ctx,out,outl,in,inl); @@ -276,11 +275,9 @@ int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, ENGINE *im } int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl) + const unsigned char *in, int inl) { - size_t i; - size_t bl; - size_t j; + int i,j,bl; if (inl <= 0) { @@ -384,7 +381,7 @@ int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) } int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl, - const unsigned char *in, size_t inl) + const unsigned char *in, int inl) { int fix_len; unsigned int b; @@ -518,10 +515,10 @@ int EVP_CIPHER_CTX_cleanup(EVP_CIPHER_CTX *c) return 1; } -int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, size_t keylen) +int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *c, int keylen) { if(c->cipher->flags & EVP_CIPH_CUSTOM_KEY_LENGTH) - return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, (int)keylen, NULL); + return EVP_CIPHER_CTX_ctrl(c, EVP_CTRL_SET_KEY_LENGTH, keylen, NULL); if(c->key_len == keylen) return 1; if((keylen > 0) && (c->cipher->flags & EVP_CIPH_VARIABLE_LENGTH)) { diff --git a/crypto/evp/evp_key.c b/crypto/evp/evp_key.c index 898ff6f1e5..361ea69ab6 100644 --- a/crypto/evp/evp_key.c +++ b/crypto/evp/evp_key.c @@ -108,7 +108,7 @@ int EVP_read_pw_string(char *buf, int len, const char *prompt, int verify) } int EVP_BytesToKey(const EVP_CIPHER *type, const EVP_MD *md, - const unsigned char *salt, const unsigned char *data, size_t datal, + const unsigned char *salt, const unsigned char *data, int datal, int count, unsigned char *key, unsigned char *iv) { EVP_MD_CTX c; diff --git a/crypto/evp/evp_lib.c b/crypto/evp/evp_lib.c index 096e4a459e..daccb66820 100644 --- a/crypto/evp/evp_lib.c +++ b/crypto/evp/evp_lib.c @@ -168,18 +168,17 @@ int EVP_CIPHER_type(const EVP_CIPHER *ctx) } } -size_t EVP_CIPHER_block_size(const EVP_CIPHER *e) +int EVP_CIPHER_block_size(const EVP_CIPHER *e) { return e->block_size; } -size_t EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) +int EVP_CIPHER_CTX_block_size(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->block_size; } -size_t EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, - const unsigned char *in, size_t inl) +int EVP_Cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, const unsigned char *in, unsigned int inl) { return ctx->cipher->do_cipher(ctx,out,in,inl); } @@ -209,22 +208,22 @@ void EVP_CIPHER_CTX_set_app_data(EVP_CIPHER_CTX *ctx, void *data) ctx->app_data = data; } -size_t EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) +int EVP_CIPHER_iv_length(const EVP_CIPHER *cipher) { return cipher->iv_len; } -size_t EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) +int EVP_CIPHER_CTX_iv_length(const EVP_CIPHER_CTX *ctx) { return ctx->cipher->iv_len; } -size_t EVP_CIPHER_key_length(const EVP_CIPHER *cipher) +int EVP_CIPHER_key_length(const EVP_CIPHER *cipher) { return cipher->key_len; } -size_t EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) +int EVP_CIPHER_CTX_key_length(const EVP_CIPHER_CTX *ctx) { return ctx->key_len; } @@ -239,7 +238,7 @@ int EVP_CIPHER_CTX_nid(const EVP_CIPHER_CTX *ctx) return ctx->cipher->nid; } -size_t EVP_MD_block_size(const EVP_MD *md) +int EVP_MD_block_size(const EVP_MD *md) { return md->block_size; } @@ -254,7 +253,7 @@ int EVP_MD_pkey_type(const EVP_MD *md) return md->pkey_type; } -size_t EVP_MD_size(const EVP_MD *md) +int EVP_MD_size(const EVP_MD *md) { if (!md) return -1; diff --git a/crypto/evp/p_open.c b/crypto/evp/p_open.c index da0afda983..53a59a295c 100644 --- a/crypto/evp/p_open.c +++ b/crypto/evp/p_open.c @@ -67,8 +67,8 @@ #include <openssl/rsa.h> int EVP_OpenInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - const unsigned char *ek, size_t ekl, const unsigned char *iv, - EVP_PKEY *priv) + const unsigned char *ek, int ekl, const unsigned char *iv, + EVP_PKEY *priv) { unsigned char *key=NULL; int i,size=0,ret=0; diff --git a/crypto/evp/p_verify.c b/crypto/evp/p_verify.c index 16a449aed1..8db46412f3 100644 --- a/crypto/evp/p_verify.c +++ b/crypto/evp/p_verify.c @@ -62,8 +62,8 @@ #include <openssl/objects.h> #include <openssl/x509.h> -int EVP_VerifyFinal(EVP_MD_CTX *ctx,const unsigned char *sigbuf, - size_t siglen,EVP_PKEY *pkey) +int EVP_VerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sigbuf, + unsigned int siglen, EVP_PKEY *pkey) { unsigned char m[EVP_MAX_MD_SIZE]; unsigned int m_len; |