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 | |
parent | 61a4bd4a18867aecea2b5f0da267ba17f1f102ea (diff) | |
download | openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.tar.gz openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.tar.bz2 openbsd-9d3143ff6ad17d4edec6f49bea7bcdf7794f64a5.zip |
delete some casts. ok miod
24 files changed, 70 insertions, 70 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; |
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c index 5b18edf508..4aa5d39293 100644 --- a/src/lib/libcrypto/bio/bf_buff.c +++ b/src/lib/libcrypto/bio/bf_buff.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bf_buff.c,v 1.18 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: bf_buff.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 | * |
@@ -345,7 +345,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
345 | } | 345 | } |
346 | ctx->ibuf_off = 0; | 346 | ctx->ibuf_off = 0; |
347 | ctx->ibuf_len = (int)num; | 347 | ctx->ibuf_len = (int)num; |
348 | memcpy(ctx->ibuf, ptr, (int)num); | 348 | memcpy(ctx->ibuf, ptr, num); |
349 | ret = 1; | 349 | ret = 1; |
350 | break; | 350 | break; |
351 | case BIO_C_SET_BUFF_SIZE: | 351 | case BIO_C_SET_BUFF_SIZE: |
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c index 8d33fe75a8..1a531d7749 100644 --- a/src/lib/libcrypto/pem/pem_lib.c +++ b/src/lib/libcrypto/pem/pem_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pem_lib.c,v 1.29 2014/07/09 11:10:51 bcook Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.30 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 | * |
@@ -102,7 +102,7 @@ PEM_def_callback(char *buf, int num, int w, void *key) | |||
102 | if (i != 0) { | 102 | if (i != 0) { |
103 | PEMerr(PEM_F_PEM_DEF_CALLBACK, | 103 | PEMerr(PEM_F_PEM_DEF_CALLBACK, |
104 | PEM_R_PROBLEMS_GETTING_PASSWORD); | 104 | PEM_R_PROBLEMS_GETTING_PASSWORD); |
105 | memset(buf, 0, (unsigned int)num); | 105 | memset(buf, 0, num); |
106 | return (-1); | 106 | return (-1); |
107 | } | 107 | } |
108 | j = strlen(buf); | 108 | j = strlen(buf); |
diff --git a/src/lib/libcrypto/rsa/rsa_none.c b/src/lib/libcrypto/rsa/rsa_none.c index 818fd26fa4..da95ecf619 100644 --- a/src/lib/libcrypto/rsa/rsa_none.c +++ b/src/lib/libcrypto/rsa/rsa_none.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_none.c,v 1.6 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_none.c,v 1.7 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 | * |
@@ -78,7 +78,7 @@ RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from, | |||
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | memcpy(to, from, (unsigned int)flen); | 81 | memcpy(to, from, flen); |
82 | return 1; | 82 | return 1; |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/src/lib/libcrypto/rsa/rsa_oaep.c b/src/lib/libcrypto/rsa/rsa_oaep.c index 1e862a99e0..38ba76b90a 100644 --- a/src/lib/libcrypto/rsa/rsa_oaep.c +++ b/src/lib/libcrypto/rsa/rsa_oaep.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_oaep.c,v 1.19 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_oaep.c,v 1.20 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Written by Ulf Moeller. This software is distributed on an "AS IS" | 2 | /* Written by Ulf Moeller. This software is distributed on an "AS IS" |
3 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ | 3 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ |
4 | 4 | ||
@@ -60,7 +60,7 @@ RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, | |||
60 | memset(db + SHA_DIGEST_LENGTH, 0, | 60 | memset(db + SHA_DIGEST_LENGTH, 0, |
61 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); | 61 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); |
62 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; | 62 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; |
63 | memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int)flen); | 63 | memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, flen); |
64 | if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0) | 64 | if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0) |
65 | return 0; | 65 | return 0; |
66 | 66 | ||
diff --git a/src/lib/libcrypto/rsa/rsa_pk1.c b/src/lib/libcrypto/rsa/rsa_pk1.c index 1d6d688d6b..b4434b455a 100644 --- a/src/lib/libcrypto/rsa/rsa_pk1.c +++ b/src/lib/libcrypto/rsa/rsa_pk1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_pk1.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_pk1.c,v 1.11 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 | * |
@@ -85,7 +85,7 @@ RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, | |||
85 | memset(p, 0xff, j); | 85 | memset(p, 0xff, j); |
86 | p += j; | 86 | p += j; |
87 | *(p++) = '\0'; | 87 | *(p++) = '\0'; |
88 | memcpy(p, from, (unsigned int)flen); | 88 | memcpy(p, from, flen); |
89 | 89 | ||
90 | return 1; | 90 | return 1; |
91 | } | 91 | } |
@@ -139,7 +139,7 @@ RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, | |||
139 | RSA_R_DATA_TOO_LARGE); | 139 | RSA_R_DATA_TOO_LARGE); |
140 | return -1; | 140 | return -1; |
141 | } | 141 | } |
142 | memcpy(to, p, (unsigned int)j); | 142 | memcpy(to, p, j); |
143 | 143 | ||
144 | return j; | 144 | return j; |
145 | } | 145 | } |
@@ -177,7 +177,7 @@ RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, | |||
177 | 177 | ||
178 | *(p++) = '\0'; | 178 | *(p++) = '\0'; |
179 | 179 | ||
180 | memcpy(p, from, (unsigned int)flen); | 180 | memcpy(p, from, flen); |
181 | return 1; | 181 | return 1; |
182 | } | 182 | } |
183 | 183 | ||
@@ -219,7 +219,7 @@ RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, | |||
219 | RSA_R_DATA_TOO_LARGE); | 219 | RSA_R_DATA_TOO_LARGE); |
220 | return -1; | 220 | return -1; |
221 | } | 221 | } |
222 | memcpy(to, p, (unsigned int)j); | 222 | memcpy(to, p, j); |
223 | 223 | ||
224 | return j; | 224 | return j; |
225 | } | 225 | } |
diff --git a/src/lib/libcrypto/rsa/rsa_ssl.c b/src/lib/libcrypto/rsa/rsa_ssl.c index fb2e228454..6c8a02086c 100644 --- a/src/lib/libcrypto/rsa/rsa_ssl.c +++ b/src/lib/libcrypto/rsa/rsa_ssl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_ssl.c,v 1.11 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 | * |
@@ -97,7 +97,7 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, | |||
97 | p += 8; | 97 | p += 8; |
98 | *(p++) = '\0'; | 98 | *(p++) = '\0'; |
99 | 99 | ||
100 | memcpy(p, from, (unsigned int)flen); | 100 | memcpy(p, from, flen); |
101 | return 1; | 101 | return 1; |
102 | } | 102 | } |
103 | 103 | ||
@@ -146,7 +146,7 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from, | |||
146 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE); | 146 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE); |
147 | return -1; | 147 | return -1; |
148 | } | 148 | } |
149 | memcpy(to, p, (unsigned int)j); | 149 | memcpy(to, p, j); |
150 | 150 | ||
151 | return j; | 151 | return j; |
152 | } | 152 | } |
diff --git a/src/lib/libcrypto/rsa/rsa_x931.c b/src/lib/libcrypto/rsa/rsa_x931.c index 74c4af91a5..e9f4df341d 100644 --- a/src/lib/libcrypto/rsa/rsa_x931.c +++ b/src/lib/libcrypto/rsa/rsa_x931.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_x931.c,v 1.5 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_x931.c,v 1.6 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -95,7 +95,7 @@ RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
95 | } | 95 | } |
96 | *p++ = 0xBA; | 96 | *p++ = 0xBA; |
97 | } | 97 | } |
98 | memcpy(p, from, (unsigned int)flen); | 98 | memcpy(p, from, flen); |
99 | p += flen; | 99 | p += flen; |
100 | *p = 0xCC; | 100 | *p = 0xCC; |
101 | return 1; | 101 | return 1; |
@@ -141,7 +141,7 @@ RSA_padding_check_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
141 | return -1; | 141 | return -1; |
142 | } | 142 | } |
143 | 143 | ||
144 | memcpy(to, p, (unsigned int)j); | 144 | memcpy(to, p, j); |
145 | 145 | ||
146 | return j; | 146 | return j; |
147 | } | 147 | } |
diff --git a/src/lib/libcrypto/x509/x509_obj.c b/src/lib/libcrypto/x509/x509_obj.c index 5d6ad80268..9647ee54bf 100644 --- a/src/lib/libcrypto/x509/x509_obj.c +++ b/src/lib/libcrypto/x509/x509_obj.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_obj.c,v 1.13 2014/06/12 15:49:31 deraadt Exp $ */ | 1 | /* $OpenBSD: x509_obj.c,v 1.14 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 | * |
@@ -142,7 +142,7 @@ X509_NAME_oneline(X509_NAME *a, char *buf, int len) | |||
142 | } else | 142 | } else |
143 | p = &(buf[lold]); | 143 | p = &(buf[lold]); |
144 | *(p++) = '/'; | 144 | *(p++) = '/'; |
145 | memcpy(p, s, (unsigned int)l1); | 145 | memcpy(p, s, l1); |
146 | p += l1; | 146 | p += l1; |
147 | *(p++) = '='; | 147 | *(p++) = '='; |
148 | q = ne->value->data; | 148 | q = ne->value->data; |
diff --git a/src/lib/libssl/src/crypto/asn1/a_bitstr.c b/src/lib/libssl/src/crypto/asn1/a_bitstr.c index bd5ae715d4..16228eb40b 100644 --- a/src/lib/libssl/src/crypto/asn1/a_bitstr.c +++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_bytes.c b/src/lib/libssl/src/crypto/asn1/a_bytes.c index 61910be5fe..abe6030750 100644 --- a/src/lib/libssl/src/crypto/asn1/a_bytes.c +++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_int.c b/src/lib/libssl/src/crypto/asn1/a_int.c index 09df551065..015d02ccdb 100644 --- a/src/lib/libssl/src/crypto/asn1/a_int.c +++ b/src/lib/libssl/src/crypto/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/libssl/src/crypto/asn1/a_object.c b/src/lib/libssl/src/crypto/asn1/a_object.c index da68905939..d524509374 100644 --- a/src/lib/libssl/src/crypto/asn1/a_object.c +++ b/src/lib/libssl/src/crypto/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; |
diff --git a/src/lib/libssl/src/crypto/bio/bf_buff.c b/src/lib/libssl/src/crypto/bio/bf_buff.c index 5b18edf508..4aa5d39293 100644 --- a/src/lib/libssl/src/crypto/bio/bf_buff.c +++ b/src/lib/libssl/src/crypto/bio/bf_buff.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bf_buff.c,v 1.18 2014/06/12 15:49:28 deraadt Exp $ */ | 1 | /* $OpenBSD: bf_buff.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 | * |
@@ -345,7 +345,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
345 | } | 345 | } |
346 | ctx->ibuf_off = 0; | 346 | ctx->ibuf_off = 0; |
347 | ctx->ibuf_len = (int)num; | 347 | ctx->ibuf_len = (int)num; |
348 | memcpy(ctx->ibuf, ptr, (int)num); | 348 | memcpy(ctx->ibuf, ptr, num); |
349 | ret = 1; | 349 | ret = 1; |
350 | break; | 350 | break; |
351 | case BIO_C_SET_BUFF_SIZE: | 351 | case BIO_C_SET_BUFF_SIZE: |
diff --git a/src/lib/libssl/src/crypto/pem/pem_lib.c b/src/lib/libssl/src/crypto/pem/pem_lib.c index 8d33fe75a8..1a531d7749 100644 --- a/src/lib/libssl/src/crypto/pem/pem_lib.c +++ b/src/lib/libssl/src/crypto/pem/pem_lib.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: pem_lib.c,v 1.29 2014/07/09 11:10:51 bcook Exp $ */ | 1 | /* $OpenBSD: pem_lib.c,v 1.30 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 | * |
@@ -102,7 +102,7 @@ PEM_def_callback(char *buf, int num, int w, void *key) | |||
102 | if (i != 0) { | 102 | if (i != 0) { |
103 | PEMerr(PEM_F_PEM_DEF_CALLBACK, | 103 | PEMerr(PEM_F_PEM_DEF_CALLBACK, |
104 | PEM_R_PROBLEMS_GETTING_PASSWORD); | 104 | PEM_R_PROBLEMS_GETTING_PASSWORD); |
105 | memset(buf, 0, (unsigned int)num); | 105 | memset(buf, 0, num); |
106 | return (-1); | 106 | return (-1); |
107 | } | 107 | } |
108 | j = strlen(buf); | 108 | j = strlen(buf); |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_none.c b/src/lib/libssl/src/crypto/rsa/rsa_none.c index 818fd26fa4..da95ecf619 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_none.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_none.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_none.c,v 1.6 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_none.c,v 1.7 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 | * |
@@ -78,7 +78,7 @@ RSA_padding_add_none(unsigned char *to, int tlen, const unsigned char *from, | |||
78 | return 0; | 78 | return 0; |
79 | } | 79 | } |
80 | 80 | ||
81 | memcpy(to, from, (unsigned int)flen); | 81 | memcpy(to, from, flen); |
82 | return 1; | 82 | return 1; |
83 | } | 83 | } |
84 | 84 | ||
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c index 1e862a99e0..38ba76b90a 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_oaep.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_oaep.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_oaep.c,v 1.19 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_oaep.c,v 1.20 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Written by Ulf Moeller. This software is distributed on an "AS IS" | 2 | /* Written by Ulf Moeller. This software is distributed on an "AS IS" |
3 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ | 3 | basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. */ |
4 | 4 | ||
@@ -60,7 +60,7 @@ RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, | |||
60 | memset(db + SHA_DIGEST_LENGTH, 0, | 60 | memset(db + SHA_DIGEST_LENGTH, 0, |
61 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); | 61 | emlen - flen - 2 * SHA_DIGEST_LENGTH - 1); |
62 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; | 62 | db[emlen - flen - SHA_DIGEST_LENGTH - 1] = 0x01; |
63 | memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, (unsigned int)flen); | 63 | memcpy(db + emlen - flen - SHA_DIGEST_LENGTH, from, flen); |
64 | if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0) | 64 | if (RAND_bytes(seed, SHA_DIGEST_LENGTH) <= 0) |
65 | return 0; | 65 | return 0; |
66 | 66 | ||
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c index 1d6d688d6b..b4434b455a 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_pk1.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_pk1.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_pk1.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_pk1.c,v 1.11 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 | * |
@@ -85,7 +85,7 @@ RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, | |||
85 | memset(p, 0xff, j); | 85 | memset(p, 0xff, j); |
86 | p += j; | 86 | p += j; |
87 | *(p++) = '\0'; | 87 | *(p++) = '\0'; |
88 | memcpy(p, from, (unsigned int)flen); | 88 | memcpy(p, from, flen); |
89 | 89 | ||
90 | return 1; | 90 | return 1; |
91 | } | 91 | } |
@@ -139,7 +139,7 @@ RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, | |||
139 | RSA_R_DATA_TOO_LARGE); | 139 | RSA_R_DATA_TOO_LARGE); |
140 | return -1; | 140 | return -1; |
141 | } | 141 | } |
142 | memcpy(to, p, (unsigned int)j); | 142 | memcpy(to, p, j); |
143 | 143 | ||
144 | return j; | 144 | return j; |
145 | } | 145 | } |
@@ -177,7 +177,7 @@ RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, | |||
177 | 177 | ||
178 | *(p++) = '\0'; | 178 | *(p++) = '\0'; |
179 | 179 | ||
180 | memcpy(p, from, (unsigned int)flen); | 180 | memcpy(p, from, flen); |
181 | return 1; | 181 | return 1; |
182 | } | 182 | } |
183 | 183 | ||
@@ -219,7 +219,7 @@ RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, | |||
219 | RSA_R_DATA_TOO_LARGE); | 219 | RSA_R_DATA_TOO_LARGE); |
220 | return -1; | 220 | return -1; |
221 | } | 221 | } |
222 | memcpy(to, p, (unsigned int)j); | 222 | memcpy(to, p, j); |
223 | 223 | ||
224 | return j; | 224 | return j; |
225 | } | 225 | } |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c index fb2e228454..6c8a02086c 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_ssl.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_ssl.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_ssl.c,v 1.10 2014/07/10 07:41:54 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_ssl.c,v 1.11 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 | * |
@@ -97,7 +97,7 @@ RSA_padding_add_SSLv23(unsigned char *to, int tlen, const unsigned char *from, | |||
97 | p += 8; | 97 | p += 8; |
98 | *(p++) = '\0'; | 98 | *(p++) = '\0'; |
99 | 99 | ||
100 | memcpy(p, from, (unsigned int)flen); | 100 | memcpy(p, from, flen); |
101 | return 1; | 101 | return 1; |
102 | } | 102 | } |
103 | 103 | ||
@@ -146,7 +146,7 @@ RSA_padding_check_SSLv23(unsigned char *to, int tlen, const unsigned char *from, | |||
146 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE); | 146 | RSAerr(RSA_F_RSA_PADDING_CHECK_SSLV23, RSA_R_DATA_TOO_LARGE); |
147 | return -1; | 147 | return -1; |
148 | } | 148 | } |
149 | memcpy(to, p, (unsigned int)j); | 149 | memcpy(to, p, j); |
150 | 150 | ||
151 | return j; | 151 | return j; |
152 | } | 152 | } |
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_x931.c b/src/lib/libssl/src/crypto/rsa/rsa_x931.c index 74c4af91a5..e9f4df341d 100644 --- a/src/lib/libssl/src/crypto/rsa/rsa_x931.c +++ b/src/lib/libssl/src/crypto/rsa/rsa_x931.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rsa_x931.c,v 1.5 2014/07/09 19:51:38 jsing Exp $ */ | 1 | /* $OpenBSD: rsa_x931.c,v 1.6 2014/07/10 11:25:13 tedu Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 2005. | 3 | * project 2005. |
4 | */ | 4 | */ |
@@ -95,7 +95,7 @@ RSA_padding_add_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
95 | } | 95 | } |
96 | *p++ = 0xBA; | 96 | *p++ = 0xBA; |
97 | } | 97 | } |
98 | memcpy(p, from, (unsigned int)flen); | 98 | memcpy(p, from, flen); |
99 | p += flen; | 99 | p += flen; |
100 | *p = 0xCC; | 100 | *p = 0xCC; |
101 | return 1; | 101 | return 1; |
@@ -141,7 +141,7 @@ RSA_padding_check_X931(unsigned char *to, int tlen, const unsigned char *from, | |||
141 | return -1; | 141 | return -1; |
142 | } | 142 | } |
143 | 143 | ||
144 | memcpy(to, p, (unsigned int)j); | 144 | memcpy(to, p, j); |
145 | 145 | ||
146 | return j; | 146 | return j; |
147 | } | 147 | } |
diff --git a/src/lib/libssl/src/crypto/x509/x509_obj.c b/src/lib/libssl/src/crypto/x509/x509_obj.c index 5d6ad80268..9647ee54bf 100644 --- a/src/lib/libssl/src/crypto/x509/x509_obj.c +++ b/src/lib/libssl/src/crypto/x509/x509_obj.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: x509_obj.c,v 1.13 2014/06/12 15:49:31 deraadt Exp $ */ | 1 | /* $OpenBSD: x509_obj.c,v 1.14 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 | * |
@@ -142,7 +142,7 @@ X509_NAME_oneline(X509_NAME *a, char *buf, int len) | |||
142 | } else | 142 | } else |
143 | p = &(buf[lold]); | 143 | p = &(buf[lold]); |
144 | *(p++) = '/'; | 144 | *(p++) = '/'; |
145 | memcpy(p, s, (unsigned int)l1); | 145 | memcpy(p, s, l1); |
146 | p += l1; | 146 | p += l1; |
147 | *(p++) = '='; | 147 | *(p++) = '='; |
148 | q = ne->value->data; | 148 | q = ne->value->data; |