summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-10 11:25:14 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-10 11:25:14 +0000
commitd190b5a8e066d2d417ad1fcf416748ae6e14b456 (patch)
treeb428160706d4041f88ead747b2aea69d37b016bb
parent9072f454e714a7c50c24423c94d84ec5a15d002e (diff)
delete some casts. ok miod
-rw-r--r--lib/libcrypto/asn1/a_bitstr.c4
-rw-r--r--lib/libcrypto/asn1/a_bytes.c8
-rw-r--r--lib/libcrypto/asn1/a_int.c10
-rw-r--r--lib/libcrypto/asn1/a_object.c6
-rw-r--r--lib/libcrypto/bio/bf_buff.c4
-rw-r--r--lib/libcrypto/pem/pem_lib.c4
-rw-r--r--lib/libcrypto/rsa/rsa_none.c4
-rw-r--r--lib/libcrypto/rsa/rsa_oaep.c4
-rw-r--r--lib/libcrypto/rsa/rsa_pk1.c10
-rw-r--r--lib/libcrypto/rsa/rsa_ssl.c6
-rw-r--r--lib/libcrypto/rsa/rsa_x931.c6
-rw-r--r--lib/libcrypto/x509/x509_obj.c4
12 files changed, 35 insertions, 35 deletions
diff --git a/lib/libcrypto/asn1/a_bitstr.c b/lib/libcrypto/asn1/a_bitstr.c
index bd5ae715d40..16228eb40bb 100644
--- a/lib/libcrypto/asn1/a_bitstr.c
+++ b/lib/libcrypto/asn1/a_bitstr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_bitstr.c,v 1.17 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: a_bitstr.c,v 1.18 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -158,7 +158,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len)
i = ERR_R_MALLOC_FAILURE;
goto err;
}
- memcpy(s, p, (int)len);
+ memcpy(s, p, len);
s[len - 1] &= (0xff << i);
p += len;
} else
diff --git a/lib/libcrypto/asn1/a_bytes.c b/lib/libcrypto/asn1/a_bytes.c
index 61910be5fe1..abe6030750a 100644
--- a/lib/libcrypto/asn1/a_bytes.c
+++ b/lib/libcrypto/asn1/a_bytes.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_bytes.c,v 1.15 2014/07/09 22:55:17 tedu Exp $ */
+/* $OpenBSD: a_bytes.c,v 1.16 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -99,12 +99,12 @@ d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp,
ret = (*a);
if (len != 0) {
- s = malloc((int)len + 1);
+ s = malloc(len + 1);
if (s == NULL) {
i = ERR_R_MALLOC_FAILURE;
goto err;
}
- memcpy(s, p, (int)len);
+ memcpy(s, p, len);
s[len]='\0';
p += len;
} else
@@ -211,7 +211,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
}
} else
s = ret->data;
- memcpy(s, p, (int)len);
+ memcpy(s, p, len);
s[len] = '\0';
p += len;
} else {
diff --git a/lib/libcrypto/asn1/a_int.c b/lib/libcrypto/asn1/a_int.c
index 09df551065f..015d02ccdbe 100644
--- a/lib/libcrypto/asn1/a_int.c
+++ b/lib/libcrypto/asn1/a_int.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_int.c,v 1.21 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: a_int.c,v 1.22 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -159,7 +159,7 @@ i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp)
if (a->length == 0)
*(p++) = 0;
else if (!neg)
- memcpy(p, a->data, (unsigned int)a->length);
+ memcpy(p, a->data, a->length);
else {
/* Begin at the end of the encoding */
n = a->data + a->length - 1;
@@ -205,7 +205,7 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len)
/* We must malloc stuff, even for 0 bytes otherwise it
* signifies a missing NULL parameter. */
- s = malloc((int)len + 1);
+ s = malloc(len + 1);
if (s == NULL) {
i = ERR_R_MALLOC_FAILURE;
goto err;
@@ -253,7 +253,7 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len)
p++;
len--;
}
- memcpy(s, p, (int)len);
+ memcpy(s, p, len);
}
free(ret->data);
@@ -319,7 +319,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length)
p++;
len--;
}
- memcpy(s, p, (int)len);
+ memcpy(s, p, len);
p += len;
}
diff --git a/lib/libcrypto/asn1/a_object.c b/lib/libcrypto/asn1/a_object.c
index da689059394..d5245093746 100644
--- a/lib/libcrypto/asn1/a_object.c
+++ b/lib/libcrypto/asn1/a_object.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: a_object.c,v 1.18 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: a_object.c,v 1.19 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -311,14 +311,14 @@ c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long len)
if ((data == NULL) || (ret->length < len)) {
ret->length = 0;
free(data);
- data = malloc(len ? (int)len : 1);
+ data = malloc(len ? len : 1);
if (data == NULL) {
i = ERR_R_MALLOC_FAILURE;
goto err;
}
ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA;
}
- memcpy(data, p, (int)len);
+ memcpy(data, p, len);
/* reattach data to object, after which it remains const */
ret->data = data;
ret->length = (int)len;
diff --git a/lib/libcrypto/bio/bf_buff.c b/lib/libcrypto/bio/bf_buff.c
index 5b18edf5081..4aa5d39293f 100644
--- a/lib/libcrypto/bio/bf_buff.c
+++ b/lib/libcrypto/bio/bf_buff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bf_buff.c,v 1.18 2014/06/12 15:49:28 deraadt Exp $ */
+/* $OpenBSD: bf_buff.c,v 1.19 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -345,7 +345,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
}
ctx->ibuf_off = 0;
ctx->ibuf_len = (int)num;
- memcpy(ctx->ibuf, ptr, (int)num);
+ memcpy(ctx->ibuf, ptr, num);
ret = 1;
break;
case BIO_C_SET_BUFF_SIZE:
diff --git a/lib/libcrypto/pem/pem_lib.c b/lib/libcrypto/pem/pem_lib.c
index 8d33fe75a85..1a531d77498 100644
--- a/lib/libcrypto/pem/pem_lib.c
+++ b/lib/libcrypto/pem/pem_lib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pem_lib.c,v 1.29 2014/07/09 11:10:51 bcook Exp $ */
+/* $OpenBSD: pem_lib.c,v 1.30 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -102,7 +102,7 @@ PEM_def_callback(char *buf, int num, int w, void *key)
if (i != 0) {
PEMerr(PEM_F_PEM_DEF_CALLBACK,
PEM_R_PROBLEMS_GETTING_PASSWORD);
- memset(buf, 0, (unsigned int)num);
+ memset(buf, 0, num);
return (-1);
}
j = strlen(buf);
diff --git a/lib/libcrypto/rsa/rsa_none.c b/lib/libcrypto/rsa/rsa_none.c
index 818fd26fa49..da95ecf6198 100644
--- a/lib/libcrypto/rsa/rsa_none.c
+++ b/lib/libcrypto/rsa/rsa_none.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_none.c,v 1.6 2014/07/09 19:51:38 jsing Exp $ */
+/* $OpenBSD: rsa_none.c,v 1.7 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -78,7 +78,7 @@ RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from,
return 0;
}
- memcpy(to, from, (unsigned int)flen);
+ memcpy(to, from, flen);
return 1;
}
diff --git a/lib/libcrypto/rsa/rsa_oaep.c b/lib/libcrypto/rsa/rsa_oaep.c
index 1e862a99e06..38ba76b90a6 100644
--- a/lib/libcrypto/rsa/rsa_oaep.c
+++ b/lib/libcrypto/rsa/rsa_oaep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_oaep.c,v 1.19 2014/07/09 19:51:38 jsing Exp $ */
+/* $OpenBSD: rsa_oaep.c,v 1.20 2014/07/10 11:25:13 tedu Exp $ */
/* Written by Ulf Moeller. This software is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */
@@ -60,7 +60,7 @@ RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen,
memset(db + SHA_DIGEST_LENGTH, 0,
emlen - flen - 2 * SHA_DIGEST_LENGTH - 1);
db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01;
- memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int)flen);
+ memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, flen);
if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0)
return 0;
diff --git a/lib/libcrypto/rsa/rsa_pk1.c b/lib/libcrypto/rsa/rsa_pk1.c
index 1d6d688d6b5..b4434b455a8 100644
--- a/lib/libcrypto/rsa/rsa_pk1.c
+++ b/lib/libcrypto/rsa/rsa_pk1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_pk1.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */
+/* $OpenBSD: rsa_pk1.c,v 1.11 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -85,7 +85,7 @@ RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen,
memset(p, 0xff, j);
p += j;
*(p++) = '\0';
- memcpy(p, from, (unsigned int)flen);
+ memcpy(p, from, flen);
return 1;
}
@@ -139,7 +139,7 @@ RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen,
RSA_R_DATA_TOO_LARGE);
return -1;
}
- memcpy(to, p, (unsigned int)j);
+ memcpy(to, p, j);
return j;
}
@@ -177,7 +177,7 @@ RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen,
*(p++) = '\0';
- memcpy(p, from, (unsigned int)flen);
+ memcpy(p, from, flen);
return 1;
}
@@ -219,7 +219,7 @@ RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
RSA_R_DATA_TOO_LARGE);
return -1;
}
- memcpy(to, p, (unsigned int)j);
+ memcpy(to, p, j);
return j;
}
diff --git a/lib/libcrypto/rsa/rsa_ssl.c b/lib/libcrypto/rsa/rsa_ssl.c
index fb2e2284545..6c8a02086cf 100644
--- a/lib/libcrypto/rsa/rsa_ssl.c
+++ b/lib/libcrypto/rsa/rsa_ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */
+/* $OpenBSD: rsa_ssl.c,v 1.11 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -97,7 +97,7 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
p += 8;
*(p++) = '\0';
- memcpy(p, from, (unsigned int)flen);
+ memcpy(p, from, flen);
return 1;
}
@@ -146,7 +146,7 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from,
RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE);
return -1;
}
- memcpy(to, p, (unsigned int)j);
+ memcpy(to, p, j);
return j;
}
diff --git a/lib/libcrypto/rsa/rsa_x931.c b/lib/libcrypto/rsa/rsa_x931.c
index 74c4af91a5f..e9f4df341d7 100644
--- a/lib/libcrypto/rsa/rsa_x931.c
+++ b/lib/libcrypto/rsa/rsa_x931.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa_x931.c,v 1.5 2014/07/09 19:51:38 jsing Exp $ */
+/* $OpenBSD: rsa_x931.c,v 1.6 2014/07/10 11:25:13 tedu Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2005.
*/
@@ -95,7 +95,7 @@ RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from,
}
*p++ = 0xBA;
}
- memcpy(p, from, (unsigned int)flen);
+ memcpy(p, from, flen);
p += flen;
*p = 0xCC;
return 1;
@@ -141,7 +141,7 @@ RSA_padding_check_X931(unsigned char *to, int tlen, const unsigned char *from,
return -1;
}
- memcpy(to, p, (unsigned int)j);
+ memcpy(to, p, j);
return j;
}
diff --git a/lib/libcrypto/x509/x509_obj.c b/lib/libcrypto/x509/x509_obj.c
index 5d6ad80268e..9647ee54bf3 100644
--- a/lib/libcrypto/x509/x509_obj.c
+++ b/lib/libcrypto/x509/x509_obj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_obj.c,v 1.13 2014/06/12 15:49:31 deraadt Exp $ */
+/* $OpenBSD: x509_obj.c,v 1.14 2014/07/10 11:25:13 tedu Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -142,7 +142,7 @@ X509_NAME_oneline(X509_NAME *a, char *buf, int len)
} else
p = &(buf[lold]);
*(p++) = '/';
- memcpy(p, s, (unsigned int)l1);
+ memcpy(p, s, l1);
p += l1;
*(p++) = '=';
q = ne->value->data;