diff --git a/crypto/rsa/blinding.c b/crypto/rsa/blinding.c index 9bd02636..1367ff68 100644 --- a/crypto/rsa/blinding.c +++ b/crypto/rsa/blinding.c @@ -134,7 +134,7 @@ static BN_BLINDING *bn_blinding_create_param(BN_BLINDING *b, const BIGNUM *e, BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, BIGNUM *mod) { BN_BLINDING *ret = NULL; - ret = (BN_BLINDING*) OPENSSL_malloc(sizeof(BN_BLINDING)); + ret = OPENSSL_malloc(sizeof(BN_BLINDING)); if (ret == NULL) { OPENSSL_PUT_ERROR(RSA, ERR_R_MALLOC_FAILURE); return NULL; diff --git a/crypto/rsa/padding.c b/crypto/rsa/padding.c index 35eb85a4..4d668706 100644 --- a/crypto/rsa/padding.c +++ b/crypto/rsa/padding.c @@ -74,7 +74,6 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len, const uint8_t *from, unsigned from_len) { unsigned j; - uint8_t *p; if (to_len < RSA_PKCS1_PADDING_SIZE) { OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); @@ -86,7 +85,7 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len, return 0; } - p = (uint8_t *)to; + uint8_t *p = to; *(p++) = 0; *(p++) = 1; /* Private Key BT (Block Type) */ @@ -155,7 +154,6 @@ int RSA_padding_check_PKCS1_type_1(uint8_t *to, unsigned to_len, int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len, const uint8_t *from, unsigned from_len) { unsigned i, j; - uint8_t *p; if (to_len < RSA_PKCS1_PADDING_SIZE) { OPENSSL_PUT_ERROR(RSA, RSA_R_KEY_SIZE_TOO_SMALL); @@ -167,7 +165,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len, return 0; } - p = (unsigned char *)to; + uint8_t *p = to; *(p++) = 0; *(p++) = 2; /* Public Key BT (Block Type) */ @@ -358,7 +356,7 @@ int RSA_padding_add_PKCS1_OAEP_mgf1(uint8_t *to, unsigned to_len, seed = to + 1; db = to + mdlen + 1; - if (!EVP_Digest((void *)param, param_len, db, NULL, md, NULL)) { + if (!EVP_Digest(param, param_len, db, NULL, md, NULL)) { return 0; } memset(db + mdlen, 0, emlen - from_len - 2 * mdlen - 1); @@ -444,7 +442,7 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(uint8_t *to, unsigned to_len, db[i] ^= maskeddb[i]; } - if (!EVP_Digest((void *)param, param_len, phash, NULL, md, NULL)) { + if (!EVP_Digest(param, param_len, phash, NULL, md, NULL)) { goto err; }