diff options
Diffstat (limited to 'crypto/rsa/padding.c')
-rw-r--r-- | crypto/rsa/padding.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/crypto/rsa/padding.c b/crypto/rsa/padding.c index 128950ae..12147ea4 100644 --- a/crypto/rsa/padding.c +++ b/crypto/rsa/padding.c @@ -59,6 +59,7 @@ #include <limits.h> #include <string.h> +#include <openssl/bn.h> #include <openssl/digest.h> #include <openssl/err.h> #include <openssl/mem.h> @@ -73,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); @@ -85,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) */ @@ -154,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); @@ -166,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) */ @@ -275,8 +274,8 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from, return 1; } -int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed, - unsigned seedlen, const EVP_MD *dgst) { +static int PKCS1_MGF1(uint8_t *mask, unsigned len, const uint8_t *seed, + unsigned seedlen, const EVP_MD *dgst) { unsigned outlen = 0; uint32_t i; uint8_t cnt[4]; @@ -357,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); @@ -443,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; } |