Can not convert ‘size_t*’ {‘long unsigned int*’} to ‘int*’, which may cause data loss or other problems.
Signed-off-by: Qi Tao taoqi10@huawei.com --- src/uadk_prov_cipher.c | 24 ++++++++++++------------ src/uadk_prov_digest.c | 3 +++ src/uadk_prov_init.c | 4 ---- 3 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/src/uadk_prov_cipher.c b/src/uadk_prov_cipher.c index 4142487..cab5217 100644 --- a/src/uadk_prov_cipher.c +++ b/src/uadk_prov_cipher.c @@ -329,9 +329,9 @@ static int uadk_prov_cipher_soft_work(struct cipher_priv_ctx *priv, unsigned cha }
static int uadk_prov_cipher_soft_final(struct cipher_priv_ctx *priv, unsigned char *out, - size_t *outl) + int *outl) { - size_t sw_final_len = 0; + int sw_final_len = 0;
if (priv->sw_cipher == NULL) return UADK_E_FAIL; @@ -683,7 +683,7 @@ static int ossl_cipher_unpadblock(unsigned char *buf, size_t *buflen, size_t blo }
static int uadk_prov_hw_cipher(struct cipher_priv_ctx *priv, unsigned char *out, - size_t *outl, size_t outsize, + int *outl, size_t outsize, const unsigned char *in, size_t inlen) { size_t blksz = priv->blksize; @@ -731,7 +731,7 @@ static int uadk_prov_hw_cipher(struct cipher_priv_ctx *priv, unsigned char *out, }
static int uadk_prov_do_cipher(struct cipher_priv_ctx *priv, unsigned char *out, - size_t *outl, size_t outsize, + int *outl, size_t outsize, const unsigned char *in, size_t inlen) { size_t blksz = priv->blksize; @@ -833,7 +833,7 @@ static OSSL_FUNC_cipher_gettable_ctx_params_fn uadk_prov_cipher_gettable_ctx_par static OSSL_FUNC_cipher_set_ctx_params_fn uadk_prov_cipher_set_ctx_params; static OSSL_FUNC_cipher_settable_ctx_params_fn uadk_prov_cipher_settable_ctx_params;
-static int uadk_prov_cipher_cipher(void *vctx, unsigned char *out, size_t *outl, +static int uadk_prov_cipher_cipher(void *vctx, unsigned char *out, int *outl, size_t outsize, const unsigned char *in, size_t inl) { @@ -863,9 +863,9 @@ static int uadk_prov_cipher_cipher(void *vctx, unsigned char *out, size_t *outl, }
static int uadk_prov_cipher_block_encrypto(struct cipher_priv_ctx *priv, - unsigned char *out, size_t *outl, size_t outsize) + unsigned char *out, int *outl, size_t outsize) { - size_t blksz = priv->blksize; + int blksz = priv->blksize; int ret;
if (priv->pad) { @@ -895,7 +895,7 @@ static int uadk_prov_cipher_block_encrypto(struct cipher_priv_ctx *priv, }
static int uadk_prov_cipher_block_decrypto(struct cipher_priv_ctx *priv, - unsigned char *out, size_t *outl, size_t outsize) + unsigned char *out, int *outl, size_t outsize) { size_t blksz = priv->blksize; int ret; @@ -934,7 +934,7 @@ static int uadk_prov_cipher_block_decrypto(struct cipher_priv_ctx *priv, }
static int uadk_prov_cipher_block_final(void *vctx, unsigned char *out, - size_t *outl, size_t outsize) + int *outl, size_t outsize) { struct cipher_priv_ctx *priv = (struct cipher_priv_ctx *)vctx; int ret; @@ -954,7 +954,7 @@ static int uadk_prov_cipher_block_final(void *vctx, unsigned char *out, }
static int uadk_prov_cipher_block_update(void *vctx, unsigned char *out, - size_t *outl, size_t outsize, + int *outl, size_t outsize, const unsigned char *in, size_t inl) { struct cipher_priv_ctx *priv = (struct cipher_priv_ctx *)vctx; @@ -976,7 +976,7 @@ static int uadk_prov_cipher_block_update(void *vctx, unsigned char *out, }
static int uadk_prov_cipher_stream_update(void *vctx, unsigned char *out, - size_t *outl, size_t outsize, + int *outl, size_t outsize, const unsigned char *in, size_t inl) { struct cipher_priv_ctx *priv = (struct cipher_priv_ctx *)vctx; @@ -1026,7 +1026,7 @@ do_soft: }
static int uadk_prov_cipher_stream_final(void *vctx, unsigned char *out, - size_t *outl, size_t outsize) + int *outl, size_t outsize) { struct cipher_priv_ctx *priv = (struct cipher_priv_ctx *)vctx;
diff --git a/src/uadk_prov_digest.c b/src/uadk_prov_digest.c index 91c091b..e0519cb 100644 --- a/src/uadk_prov_digest.c +++ b/src/uadk_prov_digest.c @@ -630,6 +630,9 @@ static void uadk_digest_cleanup(struct digest_priv_ctx *priv)
if (priv->data) OPENSSL_free(priv->data); + + if (priv->soft_ctx) + OPENSSL_free(priv->soft_ctx); }
/* some params related code is copied from OpenSSL v3.0 prov/digestcommon.h */ diff --git a/src/uadk_prov_init.c b/src/uadk_prov_init.c index d4adb20..010c87b 100644 --- a/src/uadk_prov_init.c +++ b/src/uadk_prov_init.c @@ -39,10 +39,6 @@ static OSSL_FUNC_core_gettable_params_fn *c_gettable_params; static OSSL_FUNC_core_get_params_fn *c_get_params; static OSSL_FUNC_core_get_libctx_fn *c_get_libctx;
-/* Functions provided by the core */ -static OSSL_FUNC_core_get_params_fn *c_get_params; -static OSSL_FUNC_core_get_libctx_fn *c_get_libctx; - struct uadk_provider_params { char *enable_sw_offload; } uadk_params;