Fix code style
Signed-off-by: Przemek Stekiel <przemyslaw.stekiel@mobica.com>
This commit is contained in:
parent
408569f91a
commit
46b2d2b643
2 changed files with 8 additions and 6 deletions
|
@ -1779,7 +1779,8 @@ static int ssl_parse_server_ecdh_params(mbedtls_ssl_context *ssl,
|
||||||
return MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE;
|
return MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
MBEDTLS_STATIC_ASSERT(sizeof(handshake->xxdh_psa_peerkey) >= UINT8_MAX, "peer key buffer too small");
|
MBEDTLS_STATIC_ASSERT(sizeof(handshake->xxdh_psa_peerkey) >= UINT8_MAX,
|
||||||
|
"peer key buffer too small");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memcpy(handshake->xxdh_psa_peerkey, *p, ecpoint_len);
|
memcpy(handshake->xxdh_psa_peerkey, *p, ecpoint_len);
|
||||||
|
|
|
@ -3909,10 +3909,10 @@ static int ssl_parse_client_key_exchange(mbedtls_ssl_context *ssl)
|
||||||
return MBEDTLS_ERR_SSL_DECODE_ERROR;
|
return MBEDTLS_ERR_SSL_DECODE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When FFDH is enabled, the array handshake->xxdh_psa_peer_key size takes into account
|
/* When FFDH is enabled, the array handshake->xxdh_psa_peer_key size takes into account
|
||||||
the sizes of the FFDH keys which are at least 2048 bits.
|
the sizes of the FFDH keys which are at least 2048 bits.
|
||||||
The size of the array is thus greater than 256 bytes which is greater than any
|
The size of the array is thus greater than 256 bytes which is greater than any
|
||||||
possible value of ecpoint_len (type uint8_t) and the check below can be skipped.*/
|
possible value of ecpoint_len (type uint8_t) and the check below can be skipped.*/
|
||||||
#if !defined(PSA_WANT_ALG_FFDH)
|
#if !defined(PSA_WANT_ALG_FFDH)
|
||||||
if (ecpoint_len > sizeof(handshake->xxdh_psa_peerkey)) {
|
if (ecpoint_len > sizeof(handshake->xxdh_psa_peerkey)) {
|
||||||
psa_destroy_key(handshake->xxdh_psa_privkey);
|
psa_destroy_key(handshake->xxdh_psa_privkey);
|
||||||
|
@ -3920,7 +3920,8 @@ static int ssl_parse_client_key_exchange(mbedtls_ssl_context *ssl)
|
||||||
return MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE;
|
return MBEDTLS_ERR_SSL_HANDSHAKE_FAILURE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
MBEDTLS_STATIC_ASSERT(sizeof(handshake->xxdh_psa_peerkey) >= UINT8_MAX, "peer key buffer too small");
|
MBEDTLS_STATIC_ASSERT(sizeof(handshake->xxdh_psa_peerkey) >= UINT8_MAX,
|
||||||
|
"peer key buffer too small");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
memcpy(handshake->xxdh_psa_peerkey, p, ecpoint_len);
|
memcpy(handshake->xxdh_psa_peerkey, p, ecpoint_len);
|
||||||
|
|
Loading…
Reference in a new issue