diff options
author | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-10 11:25:14 +0000 |
---|---|---|
committer | Ted Unangst <tedu@cvs.openbsd.org> | 2014-07-10 11:25:14 +0000 |
commit | d190b5a8e066d2d417ad1fcf416748ae6e14b456 (patch) | |
tree | b428160706d4041f88ead747b2aea69d37b016bb /lib/libcrypto/asn1 | |
parent | 9072f454e714a7c50c24423c94d84ec5a15d002e (diff) |
delete some casts. ok miod
Diffstat (limited to 'lib/libcrypto/asn1')
-rw-r--r-- | lib/libcrypto/asn1/a_bitstr.c | 4 | ||||
-rw-r--r-- | lib/libcrypto/asn1/a_bytes.c | 8 | ||||
-rw-r--r-- | lib/libcrypto/asn1/a_int.c | 10 | ||||
-rw-r--r-- | lib/libcrypto/asn1/a_object.c | 6 |
4 files changed, 14 insertions, 14 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; |