From 243442e0f6d87748dcaccc2d2d3bf5605be3e3a9 Mon Sep 17 00:00:00 2001 From: miod <> Date: Sun, 19 Jul 2015 18:29:31 +0000 Subject: Drop stupid (int) casts for the arguments of malloc() and friends. This is not 16-bit MS-DOS anymore. ok bcook@ tedu@ --- src/lib/libcrypto/asn1/a_bitstr.c | 4 ++-- src/lib/libcrypto/asn1/a_int.c | 4 ++-- src/lib/libcrypto/asn1/a_sign.c | 6 +++--- src/lib/libcrypto/bio/bf_buff.c | 8 ++++---- src/lib/libcrypto/bio/bf_lbuf.c | 4 ++-- src/lib/libcrypto/ocsp/ocsp_ext.c | 6 +++--- src/lib/libcrypto/pem/pem_lib.c | 4 ++-- src/lib/libcrypto/rsa/rsa_saos.c | 6 +++--- src/lib/libcrypto/rsa/rsa_sign.c | 6 +++--- src/lib/libssl/src/crypto/asn1/a_bitstr.c | 4 ++-- src/lib/libssl/src/crypto/asn1/a_int.c | 4 ++-- src/lib/libssl/src/crypto/asn1/a_sign.c | 6 +++--- src/lib/libssl/src/crypto/bio/bf_buff.c | 8 ++++---- src/lib/libssl/src/crypto/bio/bf_lbuf.c | 4 ++-- src/lib/libssl/src/crypto/ocsp/ocsp_ext.c | 6 +++--- src/lib/libssl/src/crypto/pem/pem_lib.c | 4 ++-- src/lib/libssl/src/crypto/rsa/rsa_saos.c | 6 +++--- src/lib/libssl/src/crypto/rsa/rsa_sign.c | 6 +++--- 18 files changed, 48 insertions(+), 48 deletions(-) (limited to 'src') 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 @@ -/* $OpenBSD: a_bitstr.c,v 1.20 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -155,7 +155,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) if (len-- > 1) /* using one because of the bits left byte */ { - s = malloc((int)len); + s = malloc(len); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; 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 @@ -/* $OpenBSD: a_int.c,v 1.26 2015/03/19 14:00:22 tedu Exp $ */ +/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -310,7 +310,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) /* 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; 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 @@ -/* $OpenBSD: a_sign.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: a_sign.c,v 1.20 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -203,7 +203,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, inl = ASN1_item_i2d(asn, &buf_in, it); outll = outl = EVP_PKEY_size(pkey); - buf_out = malloc((unsigned int)outl); + buf_out = malloc(outl); if ((buf_in == NULL) || (buf_out == NULL)) { outl = 0; 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, err: EVP_MD_CTX_cleanup(ctx); if (buf_in != NULL) { - OPENSSL_cleanse((char *)buf_in, (unsigned int)inl); + OPENSSL_cleanse((char *)buf_in, inl); free(buf_in); } 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 @@ -/* $OpenBSD: bf_buff.c,v 1.22 2015/07/19 01:18:17 beck Exp $ */ +/* $OpenBSD: bf_buff.c,v 1.23 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -339,7 +339,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_C_SET_BUFF_READ_DATA: if (num > ctx->ibuf_size) { - p1 = malloc((int)num); + p1 = malloc(num); if (p1 == NULL) goto malloc_error; free(ctx->ibuf); @@ -369,12 +369,12 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) p1 = ctx->ibuf; p2 = ctx->obuf; if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { - p1 = malloc((int)num); + p1 = malloc(num); if (p1 == NULL) goto malloc_error; } if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { - p2 = malloc((int)num); + p2 = malloc(num); if (p2 == NULL) { if (p1 != ctx->ibuf) 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 @@ -/* $OpenBSD: bf_lbuf.c,v 1.12 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bf_lbuf.c,v 1.13 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -280,7 +280,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) obs = (int)num; p = ctx->obuf; if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { - p = malloc((int)num); + p = malloc(num); if (p == NULL) goto malloc_error; } 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 @@ -/* $OpenBSD: ocsp_ext.c,v 1.13 2014/10/28 05:46:56 miod Exp $ */ +/* $OpenBSD: ocsp_ext.c,v 1.14 2015/07/19 18:29:31 miod Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -326,7 +326,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data, if (data) { if ((i = i2d(data, NULL)) <= 0) goto err; - if (!(b = p = malloc((unsigned int)i))) + if (!(b = p = malloc(i))) goto err; if (i2d(data, &p) <= 0) goto err; @@ -335,7 +335,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data, (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE)) <= 0) goto err; - if (!(b = p = malloc((unsigned int)i))) + if (!(b = p = malloc(i))) goto err; if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p, (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 @@ -/* $OpenBSD: pem_lib.c,v 1.40 2015/07/16 02:14:48 miod Exp $ */ +/* $OpenBSD: pem_lib.c,v 1.41 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -370,7 +370,7 @@ PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x, } /* dzise + 8 bytes are needed */ /* actually it needs the cipher block size extra... */ - data = malloc((unsigned int)dsize + 20); + data = malloc(dsize + 20); if (data == NULL) { PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE); 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 @@ -/* $OpenBSD: rsa_saos.c,v 1.16 2014/07/12 16:03:37 miod Exp $ */ +/* $OpenBSD: rsa_saos.c,v 1.17 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -84,7 +84,7 @@ RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, unsigned int m_len, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); return 0; } - s = malloc((unsigned int)j + 1); + s = malloc(j + 1); if (s == NULL) { RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE); return 0; @@ -117,7 +117,7 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m, return 0; } - s = malloc((unsigned int)siglen); + s = malloc(siglen); if (s == NULL) { RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING, 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 @@ -/* $OpenBSD: rsa_sign.c,v 1.23 2015/06/20 01:07:25 doug Exp $ */ +/* $OpenBSD: rsa_sign.c,v 1.24 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,7 +121,7 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len, return 0; } if (type != NID_md5_sha1) { - tmps = malloc((unsigned int)j + 1); + tmps = malloc(j + 1); if (tmps == NULL) { RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE); return 0; @@ -166,7 +166,7 @@ int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, return 1; } - s = malloc((unsigned int)siglen); + s = malloc(siglen); if (s == NULL) { RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE); 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 @@ -/* $OpenBSD: a_bitstr.c,v 1.20 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: a_bitstr.c,v 1.21 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -155,7 +155,7 @@ c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a, const unsigned char **pp, long len) if (len-- > 1) /* using one because of the bits left byte */ { - s = malloc((int)len); + s = malloc(len); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; 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 @@ -/* $OpenBSD: a_int.c,v 1.26 2015/03/19 14:00:22 tedu Exp $ */ +/* $OpenBSD: a_int.c,v 1.27 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -310,7 +310,7 @@ d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, long length) /* 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; 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 @@ -/* $OpenBSD: a_sign.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: a_sign.c,v 1.20 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -203,7 +203,7 @@ ASN1_item_sign_ctx(const ASN1_ITEM *it, X509_ALGOR *algor1, X509_ALGOR *algor2, inl = ASN1_item_i2d(asn, &buf_in, it); outll = outl = EVP_PKEY_size(pkey); - buf_out = malloc((unsigned int)outl); + buf_out = malloc(outl); if ((buf_in == NULL) || (buf_out == NULL)) { outl = 0; 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, err: EVP_MD_CTX_cleanup(ctx); if (buf_in != NULL) { - OPENSSL_cleanse((char *)buf_in, (unsigned int)inl); + OPENSSL_cleanse((char *)buf_in, inl); free(buf_in); } 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 @@ -/* $OpenBSD: bf_buff.c,v 1.22 2015/07/19 01:18:17 beck Exp $ */ +/* $OpenBSD: bf_buff.c,v 1.23 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -339,7 +339,7 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) break; case BIO_C_SET_BUFF_READ_DATA: if (num > ctx->ibuf_size) { - p1 = malloc((int)num); + p1 = malloc(num); if (p1 == NULL) goto malloc_error; free(ctx->ibuf); @@ -369,12 +369,12 @@ buffer_ctrl(BIO *b, int cmd, long num, void *ptr) p1 = ctx->ibuf; p2 = ctx->obuf; if ((ibs > DEFAULT_BUFFER_SIZE) && (ibs != ctx->ibuf_size)) { - p1 = malloc((int)num); + p1 = malloc(num); if (p1 == NULL) goto malloc_error; } if ((obs > DEFAULT_BUFFER_SIZE) && (obs != ctx->obuf_size)) { - p2 = malloc((int)num); + p2 = malloc(num); if (p2 == NULL) { if (p1 != ctx->ibuf) 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 @@ -/* $OpenBSD: bf_lbuf.c,v 1.12 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: bf_lbuf.c,v 1.13 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -280,7 +280,7 @@ linebuffer_ctrl(BIO *b, int cmd, long num, void *ptr) obs = (int)num; p = ctx->obuf; if ((obs > DEFAULT_LINEBUFFER_SIZE) && (obs != ctx->obuf_size)) { - p = malloc((int)num); + p = malloc(num); if (p == NULL) goto malloc_error; } 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 @@ -/* $OpenBSD: ocsp_ext.c,v 1.13 2014/10/28 05:46:56 miod Exp $ */ +/* $OpenBSD: ocsp_ext.c,v 1.14 2015/07/19 18:29:31 miod Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -326,7 +326,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data, if (data) { if ((i = i2d(data, NULL)) <= 0) goto err; - if (!(b = p = malloc((unsigned int)i))) + if (!(b = p = malloc(i))) goto err; if (i2d(data, &p) <= 0) goto err; @@ -335,7 +335,7 @@ ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d, void *data, (I2D_OF(ASN1_OBJECT))i2d, V_ASN1_SEQUENCE, V_ASN1_UNIVERSAL, IS_SEQUENCE)) <= 0) goto err; - if (!(b = p = malloc((unsigned int)i))) + if (!(b = p = malloc(i))) goto err; if (i2d_ASN1_SET_OF_ASN1_OBJECT(sk, &p, (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 @@ -/* $OpenBSD: pem_lib.c,v 1.40 2015/07/16 02:14:48 miod Exp $ */ +/* $OpenBSD: pem_lib.c,v 1.41 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -370,7 +370,7 @@ PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, void *x, } /* dzise + 8 bytes are needed */ /* actually it needs the cipher block size extra... */ - data = malloc((unsigned int)dsize + 20); + data = malloc(dsize + 20); if (data == NULL) { PEMerr(PEM_F_PEM_ASN1_WRITE_BIO, ERR_R_MALLOC_FAILURE); 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 @@ -/* $OpenBSD: rsa_saos.c,v 1.16 2014/07/12 16:03:37 miod Exp $ */ +/* $OpenBSD: rsa_saos.c,v 1.17 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -84,7 +84,7 @@ RSA_sign_ASN1_OCTET_STRING(int type, const unsigned char *m, unsigned int m_len, RSA_R_DIGEST_TOO_BIG_FOR_RSA_KEY); return 0; } - s = malloc((unsigned int)j + 1); + s = malloc(j + 1); if (s == NULL) { RSAerr(RSA_F_RSA_SIGN_ASN1_OCTET_STRING, ERR_R_MALLOC_FAILURE); return 0; @@ -117,7 +117,7 @@ RSA_verify_ASN1_OCTET_STRING(int dtype, const unsigned char *m, return 0; } - s = malloc((unsigned int)siglen); + s = malloc(siglen); if (s == NULL) { RSAerr(RSA_F_RSA_VERIFY_ASN1_OCTET_STRING, 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 @@ -/* $OpenBSD: rsa_sign.c,v 1.23 2015/06/20 01:07:25 doug Exp $ */ +/* $OpenBSD: rsa_sign.c,v 1.24 2015/07/19 18:29:31 miod Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -121,7 +121,7 @@ RSA_sign(int type, const unsigned char *m, unsigned int m_len, return 0; } if (type != NID_md5_sha1) { - tmps = malloc((unsigned int)j + 1); + tmps = malloc(j + 1); if (tmps == NULL) { RSAerr(RSA_F_RSA_SIGN, ERR_R_MALLOC_FAILURE); return 0; @@ -166,7 +166,7 @@ int_rsa_verify(int dtype, const unsigned char *m, unsigned int m_len, return 1; } - s = malloc((unsigned int)siglen); + s = malloc(siglen); if (s == NULL) { RSAerr(RSA_F_INT_RSA_VERIFY, ERR_R_MALLOC_FAILURE); goto err; -- cgit v1.2.3-55-g6feb