Fix size_t casting.

Signed-off-by: Pol Henarejos <pol.henarejos@cttc.es>
This commit is contained in:
Pol Henarejos
2024-01-02 19:56:38 +01:00
parent a1d7733b95
commit 2b92d89ab7
6 changed files with 30 additions and 30 deletions

View File

@@ -111,9 +111,9 @@ int cmd_extras() {
memcpy(mse.Qpt, apdu.data, sizeof(mse.Qpt));
uint8_t buf[MBEDTLS_ECP_MAX_BYTES];
uint16_t olen = 0;
size_t olen = 0;
ret = mbedtls_ecdh_calc_secret(&hkey,
(size_t *)&olen,
&olen,
buf,
MBEDTLS_ECP_MAX_BYTES,
random_gen,
@@ -141,7 +141,7 @@ int cmd_extras() {
ret = mbedtls_ecp_point_write_binary(&hkey.ctx.mbed_ecdh.grp,
&hkey.ctx.mbed_ecdh.Q,
MBEDTLS_ECP_PF_UNCOMPRESSED,
(size_t *)&olen,
&olen,
res_APDU,
4096);
mbedtls_ecdh_free(&hkey);
@@ -149,7 +149,7 @@ int cmd_extras() {
return SW_EXEC_ERROR();
}
mse.init = true;
res_APDU_size = olen;
res_APDU_size = (uint16_t)olen;
}
else if (P2(apdu) == 0x02 || P2(apdu) == 0x03 || P2(apdu) == 0x04) {
if (mse.init == false) {