diff options
author | tedu <> | 2014-07-10 11:25:13 +0000 |
---|---|---|
committer | tedu <> | 2014-07-10 11:25:13 +0000 |
commit | 9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5 (patch) | |
tree | 7e6c9ca704304f6f99e87e8dac39a6d87504a1c5 /src/lib/libcrypto/asn1 | |
parent | 61a4bd4a18867aecea2b5f0da267ba17f1f102ea (diff) | |
download | openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.tar.gz openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.tar.bz2 openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.zip |
delete some casts. ok miod
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r-- | src/lib/libcrypto/asn1/a_bitstr.c | 4 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_bytes.c | 8 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_int.c | 10 | ||||
-rw-r--r-- | src/lib/libcrypto/asn1/a_object.c | 6 |
4 files changed, 14 insertions, 14 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c index bd5ae715d4..16228eb40b 100644 --- a/src/lib/libcrypto/asn1/a_bitstr.c +++ b/src/lib/libcrypto/asn1/a_bitstr.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_bitstr.c,v 1.17 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: a_bitstr.c,v 1.18 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -158,7 +158,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) | |||
158 | i = ERR_R_MALLOC_FAILURE; | 158 | i = ERR_R_MALLOC_FAILURE; |
159 | goto err; | 159 | goto err; |
160 | } | 160 | } |
161 | memcpy(s, p, (int)len); | 161 | memcpy(s, p, len); |
162 | s[len - 1] &= (0xff << i); | 162 | s[len - 1] &= (0xff << i); |
163 | p += len; | 163 | p += len; |
164 | } else | 164 | } else |
diff --git a/src/lib/libcrypto/asn1/a_bytes.c b/src/lib/libcrypto/asn1/a_bytes.c index 61910be5fe..abe6030750 100644 --- a/src/lib/libcrypto/asn1/a_bytes.c +++ b/src/lib/libcrypto/asn1/a_bytes.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_bytes.c,v 1.15 2014/07/09 22:55:17 tedu Exp $ */ | 1 | /* $OpenBSD: a_bytes.c,v 1.16 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -99,12 +99,12 @@ d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
99 | ret = (*a); | 99 | ret = (*a); |
100 | 100 | ||
101 | if (len != 0) { | 101 | if (len != 0) { |
102 | s = malloc((int)len + 1); | 102 | s = malloc(len + 1); |
103 | if (s == NULL) { | 103 | if (s == NULL) { |
104 | i = ERR_R_MALLOC_FAILURE; | 104 | i = ERR_R_MALLOC_FAILURE; |
105 | goto err; | 105 | goto err; |
106 | } | 106 | } |
107 | memcpy(s, p, (int)len); | 107 | memcpy(s, p, len); |
108 | s[len]='\0'; | 108 | s[len]='\0'; |
109 | p += len; | 109 | p += len; |
110 | } else | 110 | } else |
@@ -211,7 +211,7 @@ d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, | |||
211 | } | 211 | } |
212 | } else | 212 | } else |
213 | s = ret->data; | 213 | s = ret->data; |
214 | memcpy(s, p, (int)len); | 214 | memcpy(s, p, len); |
215 | s[len] = '\0'; | 215 | s[len] = '\0'; |
216 | p += len; | 216 | p += len; |
217 | } else { | 217 | } else { |
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c index 09df551065..015d02ccdb 100644 --- a/src/lib/libcrypto/asn1/a_int.c +++ b/src/lib/libcrypto/asn1/a_int.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_int.c,v 1.21 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: a_int.c,v 1.22 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -159,7 +159,7 @@ i2c_ASN1_INTEGER(ASN1_INTEGER *a, unsigned char **pp) | |||
159 | if (a->length == 0) | 159 | if (a->length == 0) |
160 | *(p++) = 0; | 160 | *(p++) = 0; |
161 | else if (!neg) | 161 | else if (!neg) |
162 | memcpy(p, a->data, (unsigned int)a->length); | 162 | memcpy(p, a->data, a->length); |
163 | else { | 163 | else { |
164 | /* Begin at the end of the encoding */ | 164 | /* Begin at the end of the encoding */ |
165 | n = a->data + a->length - 1; | 165 | n = a->data + a->length - 1; |
@@ -205,7 +205,7 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len) | |||
205 | 205 | ||
206 | /* We must malloc stuff, even for 0 bytes otherwise it | 206 | /* We must malloc stuff, even for 0 bytes otherwise it |
207 | * signifies a missing NULL parameter. */ | 207 | * signifies a missing NULL parameter. */ |
208 | s = malloc((int)len + 1); | 208 | s = malloc(len + 1); |
209 | if (s == NULL) { | 209 | if (s == NULL) { |
210 | i = ERR_R_MALLOC_FAILURE; | 210 | i = ERR_R_MALLOC_FAILURE; |
211 | goto err; | 211 | goto err; |
@@ -253,7 +253,7 @@ c2i_ASN1_INTEGER(ASN1_INTEGER **a, const unsigned char **pp, long len) | |||
253 | p++; | 253 | p++; |
254 | len--; | 254 | len--; |
255 | } | 255 | } |
256 | memcpy(s, p, (int)len); | 256 | memcpy(s, p, len); |
257 | } | 257 | } |
258 | 258 | ||
259 | free(ret->data); | 259 | free(ret->data); |
@@ -319,7 +319,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) | |||
319 | p++; | 319 | p++; |
320 | len--; | 320 | len--; |
321 | } | 321 | } |
322 | memcpy(s, p, (int)len); | 322 | memcpy(s, p, len); |
323 | p += len; | 323 | p += len; |
324 | } | 324 | } |
325 | 325 | ||
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c index da68905939..d524509374 100644 --- a/src/lib/libcrypto/asn1/a_object.c +++ b/src/lib/libcrypto/asn1/a_object.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: a_object.c,v 1.18 2014/06/12 15:49:27 deraadt Exp $ */ | 1 | /* $OpenBSD: a_object.c,v 1.19 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -311,14 +311,14 @@ c2i_ASN1_OBJECT(ASN1_OBJECT **a, const unsigned char **pp, long len) | |||
311 | if ((data == NULL) || (ret->length < len)) { | 311 | if ((data == NULL) || (ret->length < len)) { |
312 | ret->length = 0; | 312 | ret->length = 0; |
313 | free(data); | 313 | free(data); |
314 | data = malloc(len ? (int)len : 1); | 314 | data = malloc(len ? len : 1); |
315 | if (data == NULL) { | 315 | if (data == NULL) { |
316 | i = ERR_R_MALLOC_FAILURE; | 316 | i = ERR_R_MALLOC_FAILURE; |
317 | goto err; | 317 | goto err; |
318 | } | 318 | } |
319 | ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA; | 319 | ret->flags |= ASN1_OBJECT_FLAG_DYNAMIC_DATA; |
320 | } | 320 | } |
321 | memcpy(data, p, (int)len); | 321 | memcpy(data, p, len); |
322 | /* reattach data to object, after which it remains const */ | 322 | /* reattach data to object, after which it remains const */ |
323 | ret->data = data; | 323 | ret->data = data; |
324 | ret->length = (int)len; | 324 | ret->length = (int)len; |