diff --git a/src/ssl.c b/src/ssl.c index 8e536ad33..17c67d60f 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -51680,7 +51680,7 @@ int wolfSSL_RSA_public_decrypt(int flen, const unsigned char* from, * rsa Key to use for encryption * padding Type of RSA padding to use. */ -int wolfSSL_RSA_private_encrypt(int len, unsigned char* in, +int wolfSSL_RSA_private_encrypt(int len, const unsigned char* in, unsigned char* out, WOLFSSL_RSA* rsa, int padding) { int sz = 0; diff --git a/wolfcrypt/src/evp.c b/wolfcrypt/src/evp.c index 03f25e107..622991c48 100644 --- a/wolfcrypt/src/evp.c +++ b/wolfcrypt/src/evp.c @@ -1817,7 +1817,7 @@ WOLFSSL_API int wolfSSL_EVP_PKEY_sign(WOLFSSL_EVP_PKEY_CTX *ctx, unsigned char * switch (ctx->pkey->type) { #if !defined(NO_RSA) && !defined(HAVE_USER_RSA) case EVP_PKEY_RSA: - len = wolfSSL_RSA_private_encrypt((int)tbslen, (unsigned char*)tbs, sig, + len = wolfSSL_RSA_private_encrypt((int)tbslen, tbs, sig, ctx->pkey->rsa, ctx->padding); if (len < 0) break; @@ -2443,7 +2443,7 @@ int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t l * returns WOLFSSL_SUCCESS on success and WOLFSSL_FAILURE on failure */ int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx, - unsigned char*sig, unsigned int siglen, WOLFSSL_EVP_PKEY *pkey) + const unsigned char*sig, unsigned int siglen, WOLFSSL_EVP_PKEY *pkey) { int ret; unsigned char md[WC_MAX_DIGEST_SIZE]; diff --git a/wolfssl/openssl/evp.h b/wolfssl/openssl/evp.h index 0c0dfe666..e3f3c608e 100644 --- a/wolfssl/openssl/evp.h +++ b/wolfssl/openssl/evp.h @@ -592,7 +592,7 @@ WOLFSSL_API int wolfSSL_EVP_SignInit_ex(WOLFSSL_EVP_MD_CTX* ctx, WOLFSSL_ENGINE *impl); WOLFSSL_API int wolfSSL_EVP_SignUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len); WOLFSSL_API int wolfSSL_EVP_VerifyFinal(WOLFSSL_EVP_MD_CTX *ctx, - unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey); + const unsigned char* sig, unsigned int sig_len, WOLFSSL_EVP_PKEY *pkey); WOLFSSL_API int wolfSSL_EVP_VerifyInit(WOLFSSL_EVP_MD_CTX *ctx, const WOLFSSL_EVP_MD *type); WOLFSSL_API int wolfSSL_EVP_VerifyUpdate(WOLFSSL_EVP_MD_CTX *ctx, const void *data, size_t len); diff --git a/wolfssl/openssl/rsa.h b/wolfssl/openssl/rsa.h index af9d3ca5e..fcbaa6c81 100644 --- a/wolfssl/openssl/rsa.h +++ b/wolfssl/openssl/rsa.h @@ -107,7 +107,7 @@ WOLFSSL_API int wolfSSL_RSA_public_encrypt(int len, const unsigned char* fr, unsigned char* to, WOLFSSL_RSA*, int padding); WOLFSSL_API int wolfSSL_RSA_private_decrypt(int len, const unsigned char* fr, unsigned char* to, WOLFSSL_RSA*, int padding); -WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, unsigned char* in, +WOLFSSL_API int wolfSSL_RSA_private_encrypt(int len, const unsigned char* in, unsigned char* out, WOLFSSL_RSA* rsa, int padding); WOLFSSL_API int wolfSSL_RSA_size(const WOLFSSL_RSA*);