summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/asn1/a_print.c5
-rw-r--r--crypto/asn1/a_set.c10
-rw-r--r--crypto/asn1/ameth_lib.c4
-rw-r--r--crypto/asn1/asn1.h14
-rw-r--r--crypto/asn1/asn1_lib.c2
-rw-r--r--crypto/asn1/asn1_locl.h10
-rw-r--r--crypto/asn1/asn1_mac.h4
-rw-r--r--crypto/asn1/asn1t.h4
-rw-r--r--crypto/asn1/d2i_pr.c2
-rw-r--r--crypto/asn1/d2i_pu.c2
-rw-r--r--crypto/asn1/evp_asn1.c2
-rw-r--r--crypto/asn1/x_pkey.c2
-rw-r--r--crypto/asn1/x_pubkey.c8
-rw-r--r--crypto/bf/bf_skey.c2
-rw-r--r--crypto/bf/blowfish.h3
-rw-r--r--crypto/dh/dh.h2
-rw-r--r--crypto/dh/dh_ameth.c2
-rw-r--r--crypto/dsa/dsa.h8
-rw-r--r--crypto/dsa/dsa_ameth.c4
-rw-r--r--crypto/ec/ec.h4
-rw-r--r--crypto/ec/ec_ameth.c4
-rw-r--r--crypto/ec/ec_asn1.c4
-rw-r--r--crypto/ecdsa/ecdsa.h2
-rw-r--r--crypto/ecdsa/ecdsatest.c4
-rw-r--r--crypto/evp/encode.c15
-rw-r--r--crypto/evp/evp.h109
-rw-r--r--crypto/evp/evp_enc.c17
-rw-r--r--crypto/evp/evp_key.c2
-rw-r--r--crypto/evp/evp_lib.c19
-rw-r--r--crypto/evp/p_open.c4
-rw-r--r--crypto/hmac/hm_ameth.c2
-rw-r--r--crypto/hmac/hmac.c7
-rw-r--r--crypto/hmac/hmac.h6
-rw-r--r--crypto/objects/obj_lib.c2
-rw-r--r--crypto/pem/pem_info.c6
-rw-r--r--crypto/rand/md_rand.c22
-rw-r--r--crypto/rand/rand.h20
-rw-r--r--crypto/rand/rand_egd.c6
-rw-r--r--crypto/rand/rand_lib.c8
-rw-r--r--crypto/rand/rand_unix.c4
-rw-r--r--crypto/rand/randfile.c10
-rw-r--r--crypto/rsa/rsa_ameth.c2
-rw-r--r--crypto/ts/ts.h19
-rw-r--r--crypto/x509/x509.h13
-rw-r--r--engines/e_4758cca.c4
-rw-r--r--engines/e_chil.c4
-rw-r--r--engines/e_cswift.c4
-rw-r--r--engines/e_sureware.c12
-rw-r--r--ssl/ssl.h4
-rw-r--r--ssl/ssl_asn1.c2
50 files changed, 222 insertions, 209 deletions
diff --git a/crypto/asn1/a_print.c b/crypto/asn1/a_print.c
index 4a20dca85c..b3700b43fb 100644
--- a/crypto/asn1/a_print.c
+++ b/crypto/asn1/a_print.c
@@ -65,11 +65,12 @@ int ASN1_PRINTABLE_type(const unsigned char *s, size_t len)
int c;
int ia5=0;
int t61=0;
+ int ignore_len = 0;
- if (len <= 0) len= -1;
+ if (len == 0) ignore_len = 1;
if (s == NULL) return(V_ASN1_PRINTABLESTRING);
- while ((*s) && (len-- != 0))
+ while (*s && !ignore_len && len-- != 0)
{
c= *(s++);
#ifndef CHARSET_EBCDIC
diff --git a/crypto/asn1/a_set.c b/crypto/asn1/a_set.c
index 02edaad9ae..09e5dc9818 100644
--- a/crypto/asn1/a_set.c
+++ b/crypto/asn1/a_set.c
@@ -65,7 +65,7 @@
typedef struct
{
unsigned char *pbData;
- int cbData;
+ size_t cbData;
} MYBLOB;
/* SetBlobCmp
@@ -85,11 +85,11 @@ static int SetBlobCmp(const void *elem1, const void *elem2 )
}
/* int is_set: if TRUE, then sort the contents (i.e. it isn't a SEQUENCE) */
-int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
- i2d_of_void *i2d, int ex_tag, int ex_class,
- int is_set)
+size_t i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class,
+ int is_set)
{
- int ret=0,r;
+ size_t ret=0,r;
int i;
unsigned char *p;
unsigned char *pStart, *pTempMem;
diff --git a/crypto/asn1/ameth_lib.c b/crypto/asn1/ameth_lib.c
index 5063191515..3be02c8793 100644
--- a/crypto/asn1/ameth_lib.c
+++ b/crypto/asn1/ameth_lib.c
@@ -416,13 +416,13 @@ void EVP_PKEY_asn1_set_private(EVP_PKEY_ASN1_METHOD *ameth,
void EVP_PKEY_asn1_set_param(EVP_PKEY_ASN1_METHOD *ameth,
int (*param_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen),
+ const unsigned char **pder, size_t 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))
{
ameth->param_decode = param_decode;
ameth->param_encode = param_encode;
diff --git a/crypto/asn1/asn1.h b/crypto/asn1/asn1.h
index f3189cc507..b2dc58a0d7 100644
--- a/crypto/asn1/asn1.h
+++ b/crypto/asn1/asn1.h
@@ -310,12 +310,12 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
#define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
+ type *d2i_##name(type **a, const unsigned char **in, size_t len); \
int i2d_##name(type *a, unsigned char **out); \
DECLARE_ASN1_ITEM(itname)
#define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
- type *d2i_##name(type **a, const unsigned char **in, long len); \
+ type *d2i_##name(type **a, const unsigned char **in, size_t len); \
int i2d_##name(const type *a, unsigned char **out); \
DECLARE_ASN1_ITEM(name)
@@ -337,7 +337,7 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
int fname##_print_ctx(BIO *out, stname *x, int indent, \
const ASN1_PCTX *pctx);
-#define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
+#define D2I_OF(type) type *(*)(type **,const unsigned char **,size_t)
#define I2D_OF(type) int (*)(type *,unsigned char **)
#define I2D_OF_const(type) int (*)(const type *,unsigned char **)
@@ -352,7 +352,7 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
#define CHECKED_PPTR_OF(type, p) \
((void**) (1 ? p : (type**)0))
-#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
+#define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,size_t)
#define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
#define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
@@ -887,9 +887,9 @@ ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s,time_t t,
int ASN1_TIME_check(ASN1_TIME *t);
ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
-int i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
- i2d_of_void *i2d, int ex_tag, int ex_class,
- int is_set);
+size_t i2d_ASN1_SET(STACK_OF(BLOCK) *a, unsigned char **pp,
+ i2d_of_void *i2d, int ex_tag, int ex_class,
+ int is_set);
STACK_OF(BLOCK) *d2i_ASN1_SET(STACK_OF(BLOCK) **a, const unsigned char **pp,
size_t length, d2i_of_void *d2i,
void (*free_func)(BLOCK), int ex_tag,
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c
index 61abef2ffc..0da09a9598 100644
--- a/crypto/asn1/asn1_lib.c
+++ b/crypto/asn1/asn1_lib.c
@@ -315,7 +315,7 @@ int asn1_const_Finish(ASN1_const_CTX *c)
return _asn1_Finish(c);
}
-int asn1_GetSequence(ASN1_const_CTX *c, long *length)
+int asn1_GetSequence(ASN1_const_CTX *c, size_t *length)
{
const unsigned char *q;
diff --git a/crypto/asn1/asn1_locl.h b/crypto/asn1/asn1_locl.h
index 7d10700fe1..c0b72ed003 100644
--- a/crypto/asn1/asn1_locl.h
+++ b/crypto/asn1/asn1_locl.h
@@ -84,24 +84,24 @@ struct evp_pkey_asn1_method_st
int (*pub_encode)(X509_PUBKEY *pub, const EVP_PKEY *pk);
int (*pub_cmp)(const EVP_PKEY *a, const EVP_PKEY *b);
int (*pub_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx);
+ ASN1_PCTX *pctx);
int (*priv_decode)(EVP_PKEY *pk, PKCS8_PRIV_KEY_INFO *p8inf);
int (*priv_encode)(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pk);
int (*priv_print)(BIO *out, const EVP_PKEY *pkey, int indent,
- ASN1_PCTX *pctx);
+ ASN1_PCTX *pctx);
int (*pkey_size)(const EVP_PKEY *pk);
int (*pkey_bits)(const EVP_PKEY *pk);
int (*param_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen);
+ const unsigned char **pder, size_t 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 (*pkey_free)(EVP_PKEY *pkey);
int (*pkey_ctrl)(EVP_PKEY *pkey, int op, long arg1, void *arg2);
@@ -109,7 +109,7 @@ struct evp_pkey_asn1_method_st
/* Legacy functions for old PEM */
int (*old_priv_decode)(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen);
+ const unsigned char **pder, size_t derlen);
int (*old_priv_encode)(const EVP_PKEY *pkey, unsigned char **pder);
} /* EVP_PKEY_ASN1_METHOD */;
diff --git a/crypto/asn1/asn1_mac.h b/crypto/asn1/asn1_mac.h
index 1383924574..a6a8dfc6a1 100644
--- a/crypto/asn1/asn1_mac.h
+++ b/crypto/asn1/asn1_mac.h
@@ -569,8 +569,8 @@ err:\
#define M_ASN1_I2D_finish() *pp=p; \
return(r);
-int asn1_GetSequence(ASN1_const_CTX *c, long *length);
-void asn1_add_error(const unsigned char *address,int offset);
+int asn1_GetSequence(ASN1_const_CTX *c, size_t *length);
+void asn1_add_error(const unsigned char *address, int offset);
#ifdef __cplusplus
}
#endif
diff --git a/crypto/asn1/asn1t.h b/crypto/asn1/asn1t.h
index 835b75a0f2..21b6565f16 100644
--- a/crypto/asn1/asn1t.h
+++ b/crypto/asn1/asn1t.h
@@ -856,7 +856,7 @@ typedef struct ASN1_STREAM_ARG_st {
IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, size_t len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
@@ -875,7 +875,7 @@ typedef struct ASN1_STREAM_ARG_st {
* ASN1 constification is done.
*/
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
- stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
+ stname *d2i_##fname(stname **a, const unsigned char **in, size_t len) \
{ \
return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
} \
diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c
index 2828944777..3ee6c38f88 100644
--- a/crypto/asn1/d2i_pr.c
+++ b/crypto/asn1/d2i_pr.c
@@ -128,7 +128,7 @@ err:
/* This works like d2i_PrivateKey() except it automatically works out the type */
EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
STACK_OF(ASN1_TYPE) *inkey;
const unsigned char *p;
diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c
index 3694f51a8c..d2567d1737 100644
--- a/crypto/asn1/d2i_pu.c
+++ b/crypto/asn1/d2i_pu.c
@@ -73,7 +73,7 @@
#endif
EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *ret;
diff --git a/crypto/asn1/evp_asn1.c b/crypto/asn1/evp_asn1.c
index b7bb7eb127..8878ec3ec6 100644
--- a/crypto/asn1/evp_asn1.c
+++ b/crypto/asn1/evp_asn1.c
@@ -142,7 +142,7 @@ int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a, long *num, unsigned char *data,
ASN1_INTEGER *ai=NULL;
ASN1_OCTET_STRING *os=NULL;
const unsigned char *p;
- long length;
+ size_t length;
ASN1_const_CTX c;
if ((a->type != V_ASN1_SEQUENCE) || (a->value.sequence == NULL))
diff --git a/crypto/asn1/x_pkey.c b/crypto/asn1/x_pkey.c
index 8453618426..62ecf0bc5e 100644
--- a/crypto/asn1/x_pkey.c
+++ b/crypto/asn1/x_pkey.c
@@ -69,7 +69,7 @@ int i2d_X509_PKEY(X509_PKEY *a, unsigned char **pp)
return(0);
}
-X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, long length)
+X509_PKEY *d2i_X509_PKEY(X509_PKEY **a, const unsigned char **pp, size_t length)
{
int i;
M_ASN1_D2I_vars(a,X509_PKEY *,X509_PKEY_new);
diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c
index d42b6a2c54..b087ee0132 100644
--- a/crypto/asn1/x_pubkey.c
+++ b/crypto/asn1/x_pubkey.c
@@ -187,7 +187,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key)
*/
EVP_PKEY *d2i_PUBKEY(EVP_PKEY **a, const unsigned char **pp,
- long length)
+ size_t length)
{
X509_PUBKEY *xpk;
EVP_PKEY *pktmp;
@@ -220,7 +220,7 @@ int i2d_PUBKEY(EVP_PKEY *a, unsigned char **pp)
*/
#ifndef OPENSSL_NO_RSA
RSA *d2i_RSA_PUBKEY(RSA **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *pkey;
RSA *key;
@@ -260,7 +260,7 @@ int i2d_RSA_PUBKEY(RSA *a, unsigned char **pp)
#ifndef OPENSSL_NO_DSA
DSA *d2i_DSA_PUBKEY(DSA **a, const unsigned char **pp,
- long length)
+ size_t length)
{
EVP_PKEY *pkey;
DSA *key;
@@ -299,7 +299,7 @@ int i2d_DSA_PUBKEY(DSA *a, unsigned char **pp)
#endif
#ifndef OPENSSL_NO_EC
-EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length)
+EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, size_t length)
{
EVP_PKEY *pkey;
EC_KEY *key;
diff --git a/crypto/bf/bf_skey.c b/crypto/bf/bf_skey.c
index 3673cdee6e..d091a1ac8d 100644
--- a/crypto/bf/bf_skey.c
+++ b/crypto/bf/bf_skey.c
@@ -62,7 +62,7 @@
#include "bf_locl.h"
#include "bf_pi.h"
-void BF_set_key(BF_KEY *key, int len, const unsigned char *data)
+void BF_set_key(BF_KEY *key, size_t len, const unsigned char *data)
{
int i;
BF_LONG *p,ri,in[2];
diff --git a/crypto/bf/blowfish.h b/crypto/bf/blowfish.h
index b97e76f9a3..02db3244b2 100644
--- a/crypto/bf/blowfish.h
+++ b/crypto/bf/blowfish.h
@@ -60,6 +60,7 @@
#define HEADER_BLOWFISH_H
#include <openssl/e_os2.h>
+#include <unistd.h>
#ifdef __cplusplus
extern "C" {
@@ -105,7 +106,7 @@ typedef struct bf_key_st
} BF_KEY;
-void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
+void BF_set_key(BF_KEY *key, size_t len, const unsigned char *data);
void BF_encrypt(BF_LONG *data,const BF_KEY *key);
void BF_decrypt(BF_LONG *data,const BF_KEY *key);
diff --git a/crypto/dh/dh.h b/crypto/dh/dh.h
index b0332f2c0c..c3f297e2be 100644
--- a/crypto/dh/dh.h
+++ b/crypto/dh/dh.h
@@ -194,7 +194,7 @@ int DH_check(const DH *dh,int *codes);
int DH_check_pub_key(const DH *dh,const BIGNUM *pub_key, int *codes);
int DH_generate_key(DH *dh);
int DH_compute_key(unsigned char *key,const BIGNUM *pub_key,DH *dh);
-DH * d2i_DHparams(DH **a,const unsigned char **pp, long length);
+DH * d2i_DHparams(DH **a,const unsigned char **pp, size_t length);
int i2d_DHparams(const DH *a,unsigned char **pp);
#ifndef OPENSSL_NO_FP_API
int DHparams_print_fp(FILE *fp, const DH *x);
diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c
index b56edda44f..4c668b27a5 100644
--- a/crypto/dh/dh_ameth.c
+++ b/crypto/dh/dh_ameth.c
@@ -296,7 +296,7 @@ static void update_buflen(const BIGNUM *b, size_t *pbuflen)
}
static int dh_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DH *dh;
if (!(dh = d2i_DHparams(NULL, pder, derlen)))
diff --git a/crypto/dsa/dsa.h b/crypto/dsa/dsa.h
index 27bc5b91ca..9d00b6ca74 100644
--- a/crypto/dsa/dsa.h
+++ b/crypto/dsa/dsa.h
@@ -177,7 +177,7 @@ struct dsa_st
DSA_SIG * DSA_SIG_new(void);
void DSA_SIG_free(DSA_SIG *a);
int i2d_DSA_SIG(const DSA_SIG *a, unsigned char **pp);
-DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, long length);
+DSA_SIG * d2i_DSA_SIG(DSA_SIG **v, const unsigned char **pp, size_t length);
DSA_SIG * DSA_do_sign(const unsigned char *dgst,int dlen,DSA *dsa);
int DSA_do_verify(const unsigned char *dgst,int dgst_len,
@@ -206,9 +206,9 @@ int DSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
int DSA_set_ex_data(DSA *d, int idx, void *arg);
void *DSA_get_ex_data(DSA *d, int idx);
-DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length);
-DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, long length);
+DSA * d2i_DSAPublicKey(DSA **a, const unsigned char **pp, size_t length);
+DSA * d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, size_t length);
+DSA * d2i_DSAparams(DSA **a, const unsigned char **pp, size_t length);
/* Deprecated version */
#ifndef OPENSSL_NO_DEPRECATED
diff --git a/crypto/dsa/dsa_ameth.c b/crypto/dsa/dsa_ameth.c
index 52290f8d61..ac31e1f4ed 100644
--- a/crypto/dsa/dsa_ameth.c
+++ b/crypto/dsa/dsa_ameth.c
@@ -480,7 +480,7 @@ err:
}
static int dsa_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DSA *dsa;
if (!(dsa = d2i_DSAparams(NULL, pder, derlen)))
@@ -517,7 +517,7 @@ static int dsa_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
}
static int old_dsa_priv_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
DSA *dsa;
if (!(dsa = d2i_DSAPrivateKey (NULL, pder, derlen)))
diff --git a/crypto/ec/ec.h b/crypto/ec/ec.h
index ee7078130c..dc0fb073ea 100644
--- a/crypto/ec/ec.h
+++ b/crypto/ec/ec.h
@@ -661,7 +661,7 @@ int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1,
typedef struct ecpk_parameters_st ECPKPARAMETERS;
-EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, long len);
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **, const unsigned char **in, size_t len);
int i2d_ECPKParameters(const EC_GROUP *, unsigned char **out);
#define d2i_ECPKParameters_bio(bp,x) ASN1_d2i_bio_of(EC_GROUP,NULL,d2i_ECPKParameters,bp,x)
@@ -810,7 +810,7 @@ int EC_KEY_check_key(const EC_KEY *key);
* \param len length of the DER encoded private key
* \return the decoded private key or NULL if an error occurred.
*/
-EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, long len);
+EC_KEY *d2i_ECPrivateKey(EC_KEY **key, const unsigned char **in, size_t len);
/** Encodes a private key object and stores the result in a buffer.
* \param key the EC_KEY object to encode
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index c1deea852e..09a16bce77 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -520,7 +520,7 @@ err:
}
static int eckey_param_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
EC_KEY *eckey;
if (!(eckey = d2i_ECParameters(NULL, pder, derlen)))
@@ -557,7 +557,7 @@ static int eckey_priv_print(BIO *bp, const EVP_PKEY *pkey, int indent,
}
static int old_ec_priv_decode(EVP_PKEY *pkey,
- const unsigned char **pder, int derlen)
+ const unsigned char **pder, size_t derlen)
{
EC_KEY *ec;
if (!(ec = d2i_ECPrivateKey (NULL, pder, derlen)))
diff --git a/crypto/ec/ec_asn1.c b/crypto/ec/ec_asn1.c
index ae55539859..ffc6d0038a 100644
--- a/crypto/ec/ec_asn1.c
+++ b/crypto/ec/ec_asn1.c
@@ -1050,7 +1050,7 @@ EC_GROUP *ec_asn1_pkparameters2group(const ECPKPARAMETERS *params)
/* EC_GROUP <-> DER encoding of ECPKPARAMETERS */
-EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, long len)
+EC_GROUP *d2i_ECPKParameters(EC_GROUP **a, const unsigned char **in, size_t len)
{
EC_GROUP *group = NULL;
ECPKPARAMETERS *params = NULL;
@@ -1099,7 +1099,7 @@ int i2d_ECPKParameters(const EC_GROUP *a, unsigned char **out)
/* some EC_KEY functions */
-EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, long len)
+EC_KEY *d2i_ECPrivateKey(EC_KEY **a, const unsigned char **in, size_t len)
{
int ok=0;
EC_KEY *ret=NULL;
diff --git a/crypto/ecdsa/ecdsa.h b/crypto/ecdsa/ecdsa.h
index e61c539812..ea1187c782 100644
--- a/crypto/ecdsa/ecdsa.h
+++ b/crypto/ecdsa/ecdsa.h
@@ -106,7 +106,7 @@ int i2d_ECDSA_SIG(const ECDSA_SIG *sig, unsigned char **pp);
* \param len length of the buffer
* \return pointer to the decoded ECDSA_SIG structure (or NULL)
*/
-ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, long len);
+ECDSA_SIG *d2i_ECDSA_SIG(ECDSA_SIG **sig, const unsigned char **pp, size_t len);
/** Computes the ECDSA signature of the given hash value using
* the supplied private key and returns the created signature.
diff --git a/crypto/ecdsa/ecdsatest.c b/crypto/ecdsa/ecdsatest.c
index aa4e1481a8..0a138c3bde 100644
--- a/crypto/ecdsa/ecdsatest.c
+++ b/crypto/ecdsa/ecdsatest.c
@@ -105,7 +105,7 @@ int test_builtin(BIO *);
/* functions to change the RAND_METHOD */
int change_rand(void);
int restore_rand(void);
-int fbytes(unsigned char *buf, int num);
+int fbytes(unsigned char *buf, size_t num);
RAND_METHOD fake_rand;
const RAND_METHOD *old_rand;
@@ -152,7 +152,7 @@ static const char *numbers[8] = {
"1712787255652165239672857892369562652652652356758119494040"
"40041670216363"};
-int fbytes(unsigned char *buf, int num)
+int fbytes(unsigned char *buf, size_t num)
{
int ret;
BIGNUM *tmp = NULL;
diff --git a/crypto/evp/encode.c b/crypto/evp/encode.c
index b42c747249..77a64437ef 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, int inl)
+ const unsigned char *in, size_t inl)
{
- int i,j;
+ size_t i,j;
unsigned int total=0;
*outl=0;
if (inl == 0) return;
- OPENSSL_assert(ctx->length <= (int)sizeof(ctx->enc_data));
+ OPENSSL_assert(ctx->length <= 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, int dlen)
+int EVP_EncodeBlock(unsigned char *t, const unsigned char *f, size_t dlen)
{
int i,ret=0;
unsigned long l;
@@ -233,9 +233,10 @@ 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, int inl)
+ const unsigned char *in, size_t inl)
{
- int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,n,ln,tmp2,exp_nl;
+ int seof= -1,eof=0,rv= -1,ret=0,i,v,tmp,ln,tmp2,exp_nl;
+ size_t n;
unsigned char *d;
n=ctx->num;
@@ -356,7 +357,7 @@ end:
return(rv);
}
-int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n)
+int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, size_t 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 985ff2f5a9..7c191943bd 100644
--- a/crypto/evp/evp.h
+++ b/