← Commit list

5b10939ef7

Viktor Szakats
Viktor Szakats
2026-06-30
SUCCESS Duration: 195s

Subject

mbedtls: replace `memset()` with `psa_hash_operation_init()`

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/md5.c+3 -2
@@ -128,8 +128,9 @@ typedef psa_hash_operation_t my_md5_ctx;
static CURLcode my_md5_init(void *ctx)
{
- memset(ctx, 0, sizeof(my_md5_ctx));
- if(psa_hash_setup(ctx, PSA_ALG_MD5) != PSA_SUCCESS)
+ psa_hash_operation_t *pctx = (psa_hash_operation_t *)ctx;
+ *pctx = psa_hash_operation_init();
+ if(psa_hash_setup(pctx, PSA_ALG_MD5) != PSA_SUCCESS)
return CURLE_OUT_OF_MEMORY;
return CURLE_OK;
}
lib/sha256.c+3 -2
@@ -148,8 +148,9 @@ typedef psa_hash_operation_t my_sha256_ctx;
static CURLcode my_sha256_init(void *ctx)
{
- memset(ctx, 0, sizeof(my_sha256_ctx));
- if(psa_hash_setup(ctx, PSA_ALG_SHA_256) != PSA_SUCCESS)
+ psa_hash_operation_t *pctx = (psa_hash_operation_t *)ctx;
+ *pctx = psa_hash_operation_init();
+ if(psa_hash_setup(pctx, PSA_ALG_SHA_256) != PSA_SUCCESS)
return CURLE_OUT_OF_MEMORY;
return CURLE_OK;
}