summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormiod <>2015-07-19 18:29:31 +0000
committermiod <>2015-07-19 18:29:31 +0000
commit243442e0f6d87748dcaccc2d2d3bf5605be3e3a9 (patch)
tree7d71f138b5b5706a448942547e5154bd651f174c /src
parent7adb4eeffce8c01c0c9ae40701483cf6eb71d9de (diff)
downloadopenbsd-243442e0f6d87748dcaccc2d2d3bf5605be3e3a9.tar.gz
openbsd-243442e0f6d87748dcaccc2d2d3bf5605be3e3a9.tar.bz2
openbsd-243442e0f6d87748dcaccc2d2d3bf5605be3e3a9.zip
Drop stupid (int) casts for the arguments of malloc() and friends. This is
not 16-bit MS-DOS anymore. ok bcook@ tedu@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libcrypto/asn1/a_int.c4
-rw-r--r--src/lib/libcrypto/asn1/a_sign.c6
-rw-r--r--src/lib/libcrypto/bio/bf_buff.c8
-rw-r--r--src/lib/libcrypto/bio/bf_lbuf.c4
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ext.c6
-rw-r--r--src/lib/libcrypto/pem/pem_lib.c4
-rw-r--r--src/lib/libcrypto/rsa/rsa_saos.c6
-rw-r--r--src/lib/libcrypto/rsa/rsa_sign.c6
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_bitstr.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_int.c4
-rw-r--r--src/lib/libssl/src/crypto/asn1/a_sign.c6
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_buff.c8
-rw-r--r--src/lib/libssl/src/crypto/bio/bf_lbuf.c4
-rw-r--r--src/lib/libssl/src/crypto/ocsp/ocsp_ext.c6
-rw-r--r--src/lib/libssl/src/crypto/pem/pem_lib.c4
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_saos.c6
-rw-r--r--src/lib/libssl/src/crypto/rsa/rsa_sign.c6
18 files changed, 48 insertions, 48 deletions
diff --git a/src/lib/libcrypto/asn1/a_bitstr.c b/src/lib/libcrypto/asn1/a_bitstr.c
index 473a945e09..5575a5c939 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.20 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod 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 *
@@ -155,7 +155,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len)
155 155
156 if (len-- > 1) /* using one because of the bits left byte */ 156 if (len-- > 1) /* using one because of the bits left byte */
157 { 157 {
158 s = malloc((int)len); 158 s = malloc(len);
159 if (s == NULL) { 159 if (s == NULL) {
160 i = ERR_R_MALLOC_FAILURE; 160 i = ERR_R_MALLOC_FAILURE;
161 goto err; 161 goto err;
diff --git a/src/lib/libcrypto/asn1/a_int.c b/src/lib/libcrypto/asn1/a_int.c
index af5d64d056..7d17aae2a2 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.26 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod 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 *
@@ -310,7 +310,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length)
310 310
311 /* We must malloc stuff, even for 0 bytes otherwise it 311 /* We must malloc stuff, even for 0 bytes otherwise it
312 * signifies a missing NULL parameter. */ 312 * signifies a missing NULL parameter. */
313 s = malloc((int)len + 1); 313 s = malloc(len + 1);
314 if (s == NULL) { 314 if (s == NULL) {
315 i = ERR_R_MALLOC_FAILURE; 315 i = ERR_R_MALLOC_FAILURE;
316 goto err; 316 goto err;
diff --git a/src/lib/libcrypto/asn1/a_sign.c b/src/lib/libcrypto/asn1/a_sign.c
index 83e7f44d12..d9385312a7 100644
--- a/src/lib/libcrypto/asn1/a_sign.c
+++ b/src/lib/libcrypto/asn1/a_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_sign.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_sign.c,v 1.20 2015/07/19 18:29:31 miod 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 *
@@ -203,7 +203,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
203 203
204 inl = ASN1_item_i2d(asn, &buf_in, it); 204 inl = ASN1_item_i2d(asn, &buf_in, it);
205 outll = outl = EVP_PKEY_size(pkey); 205 outll = outl = EVP_PKEY_size(pkey);
206 buf_out = malloc((unsigned int)outl); 206 buf_out = malloc(outl);
207 if ((buf_in == NULL) || (buf_out == NULL)) { 207 if ((buf_in == NULL) || (buf_out == NULL)) {
208 outl = 0; 208 outl = 0;
209 ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_MALLOC_FAILURE); 209 ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_MALLOC_FAILURE);
@@ -229,7 +229,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
229err: 229err:
230 EVP_MD_CTX_cleanup(ctx); 230 EVP_MD_CTX_cleanup(ctx);
231 if (buf_in != NULL) { 231 if (buf_in != NULL) {
232 OPENSSL_cleanse((char *)buf_in, (unsigned int)inl); 232 OPENSSL_cleanse((char *)buf_in, inl);
233 free(buf_in); 233 free(buf_in);
234 } 234 }
235 if (buf_out != NULL) { 235 if (buf_out != NULL) {
diff --git a/src/lib/libcrypto/bio/bf_buff.c b/src/lib/libcrypto/bio/bf_buff.c
index 639e3f318d..588cc48a28 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.22 2015/07/19 01:18:17 beck Exp $ */ 1/* $OpenBSD: bf_buff.c,v 1.23 2015/07/19 18:29:31 miod 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 *
@@ -339,7 +339,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
339 break; 339 break;
340 case BIO_C_SET_BUFF_READ_DATA: 340 case BIO_C_SET_BUFF_READ_DATA:
341 if (num > ctx->ibuf_size) { 341 if (num > ctx->ibuf_size) {
342 p1 = malloc((int)num); 342 p1 = malloc(num);
343 if (p1 == NULL) 343 if (p1 == NULL)
344 goto malloc_error; 344 goto malloc_error;
345 free(ctx->ibuf); 345 free(ctx->ibuf);
@@ -369,12 +369,12 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
369 p1 = ctx->ibuf; 369 p1 = ctx->ibuf;
370 p2 = ctx->obuf; 370 p2 = ctx->obuf;
371 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { 371 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) {
372 p1 = malloc((int)num); 372 p1 = malloc(num);
373 if (p1 == NULL) 373 if (p1 == NULL)
374 goto malloc_error; 374 goto malloc_error;
375 } 375 }
376 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { 376 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) {
377 p2 = malloc((int)num); 377 p2 = malloc(num);
378 if (p2 == NULL) { 378 if (p2 == NULL) {
379 if (p1 != ctx->ibuf) 379 if (p1 != ctx->ibuf)
380 free(p1); 380 free(p1);
diff --git a/src/lib/libcrypto/bio/bf_lbuf.c b/src/lib/libcrypto/bio/bf_lbuf.c
index e90b7f239f..7978fdb347 100644
--- a/src/lib/libcrypto/bio/bf_lbuf.c
+++ b/src/lib/libcrypto/bio/bf_lbuf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_lbuf.c,v 1.12 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: bf_lbuf.c,v 1.13 2015/07/19 18:29:31 miod 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 *
@@ -280,7 +280,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
280 obs = (int)num; 280 obs = (int)num;
281 p = ctx->obuf; 281 p = ctx->obuf;
282 if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { 282 if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) {
283 p = malloc((int)num); 283 p = malloc(num);
284 if (p == NULL) 284 if (p == NULL)
285 goto malloc_error; 285 goto malloc_error;
286 } 286 }
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c
index 7e69ad4fe0..edcf5bcca8 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ext.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.13 2014/10/28 05:46:56 miod Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.14 2015/07/19 18:29:31 miod Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -326,7 +326,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data,
326 if (data) { 326 if (data) {
327 if ((i = i2d(data, NULL)) <= 0) 327 if ((i = i2d(data, NULL)) <= 0)
328 goto err; 328 goto err;
329 if (!(b = p = malloc((unsigned int)i))) 329 if (!(b = p = malloc(i)))
330 goto err; 330 goto err;
331 if (i2d(data, &p) <= 0) 331 if (i2d(data, &p) <= 0)
332 goto err; 332 goto err;
@@ -335,7 +335,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data,
335 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, 335 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL,
336 IS_SEQUENCE)) <= 0) 336 IS_SEQUENCE)) <= 0)
337 goto err; 337 goto err;
338 if (!(b = p = malloc((unsigned int)i))) 338 if (!(b = p = malloc(i)))
339 goto err; 339 goto err;
340 if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p, 340 if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p,
341 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, 341 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE,
diff --git a/src/lib/libcrypto/pem/pem_lib.c b/src/lib/libcrypto/pem/pem_lib.c
index 221b308d71..6f8759a9ee 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.40 2015/07/16 02:14:48 miod Exp $ */ 1/* $OpenBSD: pem_lib.c,v 1.41 2015/07/19 18:29:31 miod 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 *
@@ -370,7 +370,7 @@ PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
370 } 370 }
371 /* dzise + 8 bytes are needed */ 371 /* dzise + 8 bytes are needed */
372 /* actually it needs the cipher block size extra... */ 372 /* actually it needs the cipher block size extra... */
373 data = malloc((unsigned int)dsize + 20); 373 data = malloc(dsize + 20);
374 if (data == NULL) { 374 if (data == NULL) {
375 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE); 375 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE);
376 goto err; 376 goto err;
diff --git a/src/lib/libcrypto/rsa/rsa_saos.c b/src/lib/libcrypto/rsa/rsa_saos.c
index adf459ee6d..3a07a7af4a 100644
--- a/src/lib/libcrypto/rsa/rsa_saos.c
+++ b/src/lib/libcrypto/rsa/rsa_saos.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_saos.c,v 1.16 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: rsa_saos.c,v 1.17 2015/07/19 18:29:31 miod 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 *
@@ -84,7 +84,7 @@ RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, unsigned int m_len,
84 RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); 84 RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
85 return 0; 85 return 0;
86 } 86 }
87 s = malloc((unsigned int)j + 1); 87 s = malloc(j + 1);
88 if (s == NULL) { 88 if (s == NULL) {
89 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE); 89 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE);
90 return 0; 90 return 0;
@@ -117,7 +117,7 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m,
117 return 0; 117 return 0;
118 } 118 }
119 119
120 s = malloc((unsigned int)siglen); 120 s = malloc(siglen);
121 if (s == NULL) { 121 if (s == NULL) {
122 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING, 122 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,
123 ERR_R_MALLOC_FAILURE); 123 ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libcrypto/rsa/rsa_sign.c b/src/lib/libcrypto/rsa/rsa_sign.c
index 09d8ef329d..db63c5f038 100644
--- a/src/lib/libcrypto/rsa/rsa_sign.c
+++ b/src/lib/libcrypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.23 2015/06/20 01:07:25 doug Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.24 2015/07/19 18:29:31 miod 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 *
@@ -121,7 +121,7 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len,
121 return 0; 121 return 0;
122 } 122 }
123 if (type != NID_md5_sha1) { 123 if (type != NID_md5_sha1) {
124 tmps = malloc((unsigned int)j + 1); 124 tmps = malloc(j + 1);
125 if (tmps == NULL) { 125 if (tmps == NULL) {
126 RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE); 126 RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE);
127 return 0; 127 return 0;
@@ -166,7 +166,7 @@ int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len,
166 return 1; 166 return 1;
167 } 167 }
168 168
169 s = malloc((unsigned int)siglen); 169 s = malloc(siglen);
170 if (s == NULL) { 170 if (s == NULL) {
171 RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE); 171 RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE);
172 goto err; 172 goto err;
diff --git a/src/lib/libssl/src/crypto/asn1/a_bitstr.c b/src/lib/libssl/src/crypto/asn1/a_bitstr.c
index 473a945e09..5575a5c939 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.20 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod 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 *
@@ -155,7 +155,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len)
155 155
156 if (len-- > 1) /* using one because of the bits left byte */ 156 if (len-- > 1) /* using one because of the bits left byte */
157 { 157 {
158 s = malloc((int)len); 158 s = malloc(len);
159 if (s == NULL) { 159 if (s == NULL) {
160 i = ERR_R_MALLOC_FAILURE; 160 i = ERR_R_MALLOC_FAILURE;
161 goto err; 161 goto err;
diff --git a/src/lib/libssl/src/crypto/asn1/a_int.c b/src/lib/libssl/src/crypto/asn1/a_int.c
index af5d64d056..7d17aae2a2 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.26 2015/03/19 14:00:22 tedu Exp $ */ 1/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod 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 *
@@ -310,7 +310,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length)
310 310
311 /* We must malloc stuff, even for 0 bytes otherwise it 311 /* We must malloc stuff, even for 0 bytes otherwise it
312 * signifies a missing NULL parameter. */ 312 * signifies a missing NULL parameter. */
313 s = malloc((int)len + 1); 313 s = malloc(len + 1);
314 if (s == NULL) { 314 if (s == NULL) {
315 i = ERR_R_MALLOC_FAILURE; 315 i = ERR_R_MALLOC_FAILURE;
316 goto err; 316 goto err;
diff --git a/src/lib/libssl/src/crypto/asn1/a_sign.c b/src/lib/libssl/src/crypto/asn1/a_sign.c
index 83e7f44d12..d9385312a7 100644
--- a/src/lib/libssl/src/crypto/asn1/a_sign.c
+++ b/src/lib/libssl/src/crypto/asn1/a_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_sign.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_sign.c,v 1.20 2015/07/19 18:29:31 miod 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 *
@@ -203,7 +203,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
203 203
204 inl = ASN1_item_i2d(asn, &buf_in, it); 204 inl = ASN1_item_i2d(asn, &buf_in, it);
205 outll = outl = EVP_PKEY_size(pkey); 205 outll = outl = EVP_PKEY_size(pkey);
206 buf_out = malloc((unsigned int)outl); 206 buf_out = malloc(outl);
207 if ((buf_in == NULL) || (buf_out == NULL)) { 207 if ((buf_in == NULL) || (buf_out == NULL)) {
208 outl = 0; 208 outl = 0;
209 ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_MALLOC_FAILURE); 209 ASN1err(ASN1_F_ASN1_ITEM_SIGN_CTX, ERR_R_MALLOC_FAILURE);
@@ -229,7 +229,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2,
229err: 229err:
230 EVP_MD_CTX_cleanup(ctx); 230 EVP_MD_CTX_cleanup(ctx);
231 if (buf_in != NULL) { 231 if (buf_in != NULL) {
232 OPENSSL_cleanse((char *)buf_in, (unsigned int)inl); 232 OPENSSL_cleanse((char *)buf_in, inl);
233 free(buf_in); 233 free(buf_in);
234 } 234 }
235 if (buf_out != NULL) { 235 if (buf_out != NULL) {
diff --git a/src/lib/libssl/src/crypto/bio/bf_buff.c b/src/lib/libssl/src/crypto/bio/bf_buff.c
index 639e3f318d..588cc48a28 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.22 2015/07/19 01:18:17 beck Exp $ */ 1/* $OpenBSD: bf_buff.c,v 1.23 2015/07/19 18:29:31 miod 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 *
@@ -339,7 +339,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
339 break; 339 break;
340 case BIO_C_SET_BUFF_READ_DATA: 340 case BIO_C_SET_BUFF_READ_DATA:
341 if (num > ctx->ibuf_size) { 341 if (num > ctx->ibuf_size) {
342 p1 = malloc((int)num); 342 p1 = malloc(num);
343 if (p1 == NULL) 343 if (p1 == NULL)
344 goto malloc_error; 344 goto malloc_error;
345 free(ctx->ibuf); 345 free(ctx->ibuf);
@@ -369,12 +369,12 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr)
369 p1 = ctx->ibuf; 369 p1 = ctx->ibuf;
370 p2 = ctx->obuf; 370 p2 = ctx->obuf;
371 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { 371 if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) {
372 p1 = malloc((int)num); 372 p1 = malloc(num);
373 if (p1 == NULL) 373 if (p1 == NULL)
374 goto malloc_error; 374 goto malloc_error;
375 } 375 }
376 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { 376 if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) {
377 p2 = malloc((int)num); 377 p2 = malloc(num);
378 if (p2 == NULL) { 378 if (p2 == NULL) {
379 if (p1 != ctx->ibuf) 379 if (p1 != ctx->ibuf)
380 free(p1); 380 free(p1);
diff --git a/src/lib/libssl/src/crypto/bio/bf_lbuf.c b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
index e90b7f239f..7978fdb347 100644
--- a/src/lib/libssl/src/crypto/bio/bf_lbuf.c
+++ b/src/lib/libssl/src/crypto/bio/bf_lbuf.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bf_lbuf.c,v 1.12 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: bf_lbuf.c,v 1.13 2015/07/19 18:29:31 miod 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 *
@@ -280,7 +280,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr)
280 obs = (int)num; 280 obs = (int)num;
281 p = ctx->obuf; 281 p = ctx->obuf;
282 if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { 282 if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) {
283 p = malloc((int)num); 283 p = malloc(num);
284 if (p == NULL) 284 if (p == NULL)
285 goto malloc_error; 285 goto malloc_error;
286 } 286 }
diff --git a/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c b/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
index 7e69ad4fe0..edcf5bcca8 100644
--- a/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
+++ b/src/lib/libssl/src/crypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.13 2014/10/28 05:46:56 miod Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.14 2015/07/19 18:29:31 miod Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -326,7 +326,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data,
326 if (data) { 326 if (data) {
327 if ((i = i2d(data, NULL)) <= 0) 327 if ((i = i2d(data, NULL)) <= 0)
328 goto err; 328 goto err;
329 if (!(b = p = malloc((unsigned int)i))) 329 if (!(b = p = malloc(i)))
330 goto err; 330 goto err;
331 if (i2d(data, &p) <= 0) 331 if (i2d(data, &p) <= 0)
332 goto err; 332 goto err;
@@ -335,7 +335,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data,
335 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, 335 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL,
336 IS_SEQUENCE)) <= 0) 336 IS_SEQUENCE)) <= 0)
337 goto err; 337 goto err;
338 if (!(b = p = malloc((unsigned int)i))) 338 if (!(b = p = malloc(i)))
339 goto err; 339 goto err;
340 if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p, 340 if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p,
341 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, 341 (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE,
diff --git a/src/lib/libssl/src/crypto/pem/pem_lib.c b/src/lib/libssl/src/crypto/pem/pem_lib.c
index 221b308d71..6f8759a9ee 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.40 2015/07/16 02:14:48 miod Exp $ */ 1/* $OpenBSD: pem_lib.c,v 1.41 2015/07/19 18:29:31 miod 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 *
@@ -370,7 +370,7 @@ PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x,
370 } 370 }
371 /* dzise + 8 bytes are needed */ 371 /* dzise + 8 bytes are needed */
372 /* actually it needs the cipher block size extra... */ 372 /* actually it needs the cipher block size extra... */
373 data = malloc((unsigned int)dsize + 20); 373 data = malloc(dsize + 20);
374 if (data == NULL) { 374 if (data == NULL) {
375 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE); 375 PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE);
376 goto err; 376 goto err;
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_saos.c b/src/lib/libssl/src/crypto/rsa/rsa_saos.c
index adf459ee6d..3a07a7af4a 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_saos.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_saos.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_saos.c,v 1.16 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: rsa_saos.c,v 1.17 2015/07/19 18:29:31 miod 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 *
@@ -84,7 +84,7 @@ RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, unsigned int m_len,
84 RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); 84 RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY);
85 return 0; 85 return 0;
86 } 86 }
87 s = malloc((unsigned int)j + 1); 87 s = malloc(j + 1);
88 if (s == NULL) { 88 if (s == NULL) {
89 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE); 89 RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE);
90 return 0; 90 return 0;
@@ -117,7 +117,7 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m,
117 return 0; 117 return 0;
118 } 118 }
119 119
120 s = malloc((unsigned int)siglen); 120 s = malloc(siglen);
121 if (s == NULL) { 121 if (s == NULL) {
122 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING, 122 RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING,
123 ERR_R_MALLOC_FAILURE); 123 ERR_R_MALLOC_FAILURE);
diff --git a/src/lib/libssl/src/crypto/rsa/rsa_sign.c b/src/lib/libssl/src/crypto/rsa/rsa_sign.c
index 09d8ef329d..db63c5f038 100644
--- a/src/lib/libssl/src/crypto/rsa/rsa_sign.c
+++ b/src/lib/libssl/src/crypto/rsa/rsa_sign.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: rsa_sign.c,v 1.23 2015/06/20 01:07:25 doug Exp $ */ 1/* $OpenBSD: rsa_sign.c,v 1.24 2015/07/19 18:29:31 miod 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 *
@@ -121,7 +121,7 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len,
121 return 0; 121 return 0;
122 } 122 }
123 if (type != NID_md5_sha1) { 123 if (type != NID_md5_sha1) {
124 tmps = malloc((unsigned int)j + 1); 124 tmps = malloc(j + 1);
125 if (tmps == NULL) { 125 if (tmps == NULL) {
126 RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE); 126 RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE);
127 return 0; 127 return 0;
@@ -166,7 +166,7 @@ int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len,
166 return 1; 166 return 1;
167 } 167 }
168 168
169 s = malloc((unsigned int)siglen); 169 s = malloc(siglen);
170 if (s == NULL) { 170 if (s == NULL) {
171 RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE); 171 RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE);
172 goto err; 172 goto err;