summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Thorpe <geoff@openssl.org>2008-11-12 03:58:08 +0000
committerGeoff Thorpe <geoff@openssl.org>2008-11-12 03:58:08 +0000
commit6343829a391df59e46e513c84b6264ee71ad9518 (patch)
tree9823103bf5828e47081ac906203516bdc332f577
parent2401debe83e8df930907a39065ebf9a54354f123 (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.
-rw-r--r--apps/s_apps.h9
-rw-r--r--apps/s_cb.c2
-rw-r--r--apps/s_socket.c4
-rw-r--r--crypto/asn1/a_bitstr.c28
-rw-r--r--crypto/asn1/a_bool.c4
-rw-r--r--crypto/asn1/a_bytes.c8
-rw-r--r--crypto/asn1/a_int.c18
-rw-r--r--crypto/asn1/a_mbstr.c14
-rw-r--r--crypto/asn1/a_object.c33
-rw-r--r--crypto/asn1/a_octet.c12
-rw-r--r--crypto/asn1/a_print.c7
-rw-r--r--crypto/asn1/a_set.c12
-rw-r--r--crypto/asn1/a_strnid.c2
-rw-r--r--crypto/asn1/a_time.c5
-rw-r--r--crypto/asn1/a_utf8.c4
-rw-r--r--crypto/asn1/ameth_lib.c4
-rw-r--r--crypto/asn1/asn1.h133
-rw-r--r--crypto/asn1/asn1_gen.c2
-rw-r--r--crypto/asn1/asn1_lib.c44
-rw-r--r--crypto/asn1/asn1_locl.h10
-rw-r--r--crypto/asn1/asn1_mac.h6
-rw-r--r--crypto/asn1/asn1_par.c26
-rw-r--r--crypto/asn1/asn1t.h4
-rw-r--r--crypto/asn1/asn_pack.c4
-rw-r--r--crypto/asn1/d2i_pr.c2
-rw-r--r--crypto/asn1/d2i_pu.c2
-rw-r--r--crypto/asn1/evp_asn1.c10
-rw-r--r--crypto/asn1/tasn_dec.c5
-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/bio/bio.h16
-rw-r--r--crypto/bio/bio_cb.c2
-rw-r--r--crypto/bio/bio_lib.c22
-rw-r--r--crypto/bn/asm/x86_64-gcc.c3
-rw-r--r--crypto/bn/bn.h35
-rw-r--r--crypto/bn/bn_add.c6
-rw-r--r--crypto/bn/bn_asm.c10
-rw-r--r--crypto/bn/bn_div.c13
-rw-r--r--crypto/bn/bn_exp.c13
-rw-r--r--crypto/bn/bn_lcl.h31
-rw-r--r--crypto/bn/bn_lib.c12
-rw-r--r--crypto/bn/bn_mpi.c2
-rw-r--r--crypto/bn/bn_mul.c24
-rw-r--r--crypto/bn/bn_nist.c5
-rw-r--r--crypto/bn/bn_print.c4
-rw-r--r--crypto/bn/bn_rand.c9
-rw-r--r--crypto/bn/bn_recp.c2
-rw-r--r--crypto/bn/bn_word.c7
-rw-r--r--crypto/camellia/cmll_locl.h2
-rw-r--r--crypto/crypto.h32
-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/e_des3.c6
-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/evp/p_verify.c4
-rw-r--r--crypto/hmac/hm_ameth.c2
-rw-r--r--crypto/hmac/hmac.c6
-rw-r--r--crypto/hmac/hmac.h6
-rw-r--r--crypto/mem.c30
-rw-r--r--crypto/mem_dbg.c10
-rw-r--r--crypto/objects/o_names.c4
-rw-r--r--crypto/objects/obj_dat.c20
-rw-r--r--crypto/objects/obj_lib.c2
-rw-r--r--crypto/objects/objects.h3
-rw-r--r--crypto/pem/pem_info.c6
-rw-r--r--crypto/pkcs12/p12_decr.c19
-rw-r--r--crypto/pkcs12/pkcs12.h3
-rw-r--r--crypto/rand/md_rand.c28
-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/d1_enc.c18
-rw-r--r--ssl/s3_clnt.c2
-rw-r--r--ssl/ssl.h4
-rw-r--r--ssl/ssl_asn1.c2
-rw-r--r--ssl/ssl_lib.c2
-rw-r--r--ssl/t1_enc.c43
100 files changed, 559 insertions, 646 deletions
diff --git a/apps/s_apps.h b/apps/s_apps.h
index a46d77b6d8..08fbbc2229 100644
--- a/apps/s_apps.h
+++ b/apps/s_apps.h
@@ -148,9 +148,7 @@ typedef fd_mask fd_set;
#define PORT_STR "4433"
#define PROTOCOL "tcp"
-int do_server(int port, int type, int *ret,
- int (*cb) (char *hostname, int s, unsigned char *context),
- unsigned char *context);
+int do_server(int port, int type, int *ret, int (*cb) (char *hostname, int s, unsigned char *context), unsigned char *context);
#ifdef HEADER_X509_H
int MS_CALLBACK verify_callback(int ok, X509_STORE_CTX *ctx);
#endif
@@ -164,12 +162,11 @@ int extract_port(char *str, short *port_ptr);
int extract_host_port(char *str,char **host_ptr,unsigned char *ip,short *p);
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
- size_t argi, long argl, long ret);
+ int argi, long argl, long ret);
#ifdef HEADER_SSL_H
void MS_CALLBACK apps_ssl_info_callback(const SSL *s, int where, int ret);
-void MS_CALLBACK msg_cb(int write_p, int version, int content_type,
- const void *buf, size_t len, SSL *ssl, void *arg);
+void MS_CALLBACK msg_cb(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
void MS_CALLBACK tlsext_cb(SSL *s, int client_server, int type,
unsigned char *data, int len,
void *arg);
diff --git a/apps/s_cb.c b/apps/s_cb.c
index d750ca9ddd..103893090a 100644
--- a/apps/s_cb.c
+++ b/apps/s_cb.c
@@ -260,7 +260,7 @@ int set_cert_key_stuff(SSL_CTX *ctx, X509 *cert, EVP_PKEY *key)
}
long MS_CALLBACK bio_dump_callback(BIO *bio, int cmd, const char *argp,
- size_t argi, long argl, long ret)
+ int argi, long argl, long ret)
{
BIO *out;
diff --git a/apps/s_socket.c b/apps/s_socket.c
index f884f6d33e..b5f9db3062 100644
--- a/apps/s_socket.c
+++ b/apps/s_socket.c
@@ -279,9 +279,7 @@ static int init_client_ip(int *sock, unsigned char ip[4], int port, int type)
return(1);
}
-int do_server(int port, int type, int *ret,
- int (*cb)(char *hostname, int s, unsigned char *context),
- unsigned char *context)
+int do_server(int port, int type, int *ret, int (*cb)(char *hostname, int s, unsigned char *context), unsigned char *context)
{
int sock;
char *name = NULL;
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
index 63331b2e1e..34179960b8 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -60,13 +60,12 @@
#include "cryptlib.h"
#include <openssl/asn1.h>
-int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, size_t len)
- { return M_ASN1_BIT_STRING_set(x, d, len); }
+int ASN1_BIT_STRING_set(ASN1_BIT_STRING *x, unsigned char *d, int len)
+{ return M_ASN1_BIT_STRING_set(x, d, len); }
int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
{
- int ret,j,bits;
- size_t len;
+ int ret,j,bits,len;
unsigned char *p,*d;
if (a == NULL) return(0);
@@ -115,7 +114,7 @@ int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a, unsigned char **pp)
}
ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
- const unsigned char **pp, size_t len)
+ const unsigned char **pp, long len)
{
ASN1_BIT_STRING *ret=NULL;
const unsigned char *p;
@@ -145,13 +144,13 @@ ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
if (len-- > 1) /* using one because of the bits left byte */
{
- s=OPENSSL_malloc(len);
+ s=(unsigned char *)OPENSSL_malloc((int)len);
if (s == NULL)
{
i=ERR_R_MALLOC_FAILURE;
goto err;
}
- memcpy(s,p,len);
+ memcpy(s,p,(int)len);
s[len-1]&=(0xff<<i);
p+=len;
}
@@ -174,10 +173,9 @@ err:
/* These next 2 functions from Goetz Babin-Ebell <babinebell@trustcenter.de>
*/
-int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value)
+int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value)
{
- int v,iv;
- size_t w;
+ int w,v,iv;
unsigned char *c;
w=n/8;
@@ -194,9 +192,11 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value)
{
if (!value) return(1); /* Don't need to set */
if (a->data == NULL)
- c=OPENSSL_malloc(w+1);
+ c=(unsigned char *)OPENSSL_malloc(w+1);
else
- c=OPENSSL_realloc_clean(a->data, a->length, w+1);
+ c=(unsigned char *)OPENSSL_realloc_clean(a->data,
+ a->length,
+ w+1);
if (c == NULL)
{
ASN1err(ASN1_F_ASN1_BIT_STRING_SET_BIT,ERR_R_MALLOC_FAILURE);
@@ -212,7 +212,7 @@ int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, size_t n, int value)
return(1);
}
-int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, size_t n)
+int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n)
{
int w,v;
@@ -230,7 +230,7 @@ int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, size_t n)
* 'len' is the length of 'flags'.
*/
int ASN1_BIT_STRING_check(ASN1_BIT_STRING *a,
- unsigned char *flags, size_t flags_len)
+ unsigned char *flags, int flags_len)
{
int i, ok;
/* Check if there is one bit set at all. */
diff --git a/crypto/asn1/a_bool.c b/crypto/asn1/a_bool.c
index bf5c079e92..331acdf053 100644
--- a/crypto/asn1/a_bool.c
+++ b/crypto/asn1/a_bool.c
@@ -75,11 +75,11 @@ int i2d_ASN1_BOOLEAN(int a, unsigned char **pp)
return(r);
}
-int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, size_t length)
+int d2i_ASN1_BOOLEAN(int *a, const unsigned char **pp, long length)
{
int ret= -1;
const unsigned char *p;
- size_t len;
+ long len;
int inf,tag,xclass;
int i=0;
diff --git a/crypto/asn1/a_bytes.c b/crypto/asn1/a_bytes.c
index 1bf9247d8e..8d13f9c931 100644
--- a/crypto/asn1/a_bytes.c
+++ b/crypto/asn1/a_bytes.c
@@ -64,12 +64,12 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c);
/* type is a 'bitmap' of acceptable string types.
*/
ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
- size_t length, int type)
+ long length, int type)
{
ASN1_STRING *ret=NULL;
const unsigned char *p;
unsigned char *s;
- size_t len;
+ long len;
int inf,tag,xclass;
int i=0;
@@ -155,12 +155,12 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass)
}
ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
- size_t length, int Ptag, int Pclass)
+ long length, int Ptag, int Pclass)
{
ASN1_STRING *ret=NULL;
const unsigned char *p;
unsigned char *s;
- size_t len;
+ long len;
int inf,tag,xclass;
int i=0;
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c
index 7691193c51..c6fd204ae3 100644
--- a/crypto/asn1/a_int.c
+++ b/crypto/asn1/a_int.c
@@ -176,7 +176,7 @@ int i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
/* Convert just ASN1 INTEGER content octets to ASN1_INTEGER structure */
ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
- size_t len)
+ long len)
{
ASN1_INTEGER *ret=NULL;
const unsigned char *p, *pend;
@@ -196,7 +196,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
/* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it
* signifies a missing NULL parameter. */
- s=OPENSSL_malloc(len+1);
+ s=(unsigned char *)OPENSSL_malloc((int)len+1);
if (s == NULL)
{
i=ERR_R_MALLOC_FAILURE;
@@ -246,7 +246,7 @@ ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp,
p++;
len--;
}
- memcpy(s,p,len);
+ memcpy(s,p,(int)len);
}
if (ret->data != NULL) OPENSSL_free(ret->data);
@@ -269,12 +269,12 @@ err:
*/
ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
- size_t length)
+ long length)
{
ASN1_INTEGER *ret=NULL;
const unsigned char *p;
unsigned char *to,*s;
- size_t len;
+ long len;
int inf,tag,xclass;
int i;
@@ -302,7 +302,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
/* We must OPENSSL_malloc stuff, even for 0 bytes otherwise it
* signifies a missing NULL parameter. */
- s=OPENSSL_malloc(len+1);
+ s=(unsigned char *)OPENSSL_malloc((int)len+1);
if (s == NULL)
{
i=ERR_R_MALLOC_FAILURE;
@@ -316,7 +316,7 @@ ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp,
p++;
len--;
}
- memcpy(s,p,len);
+ memcpy(s,p,(int)len);
p+=len;
}
@@ -405,7 +405,7 @@ long ASN1_INTEGER_get(const ASN1_INTEGER *a)
ASN1_INTEGER *BN_to_ASN1_