Merge pull request #6680 from valeriosetti/issue6599

Allow isolation of EC J-PAKE password when used in TLS
This commit is contained in:
Manuel Pégourié-Gonnard 2022-12-14 11:04:33 +01:00 committed by GitHub
commit c98624af3c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 457 additions and 58 deletions

View file

@ -3899,6 +3899,23 @@ void mbedtls_ssl_conf_sni( mbedtls_ssl_config *conf,
int mbedtls_ssl_set_hs_ecjpake_password( mbedtls_ssl_context *ssl,
const unsigned char *pw,
size_t pw_len );
/**
* \brief Set the EC J-PAKE opaque password for current handshake.
*
* \note The key must remain valid until the handshake is over.
*
* \note The SSL context needs to be already set up. The right place
* to call this function is between \c mbedtls_ssl_setup() or
* \c mbedtls_ssl_reset() and \c mbedtls_ssl_handshake().
*
* \param ssl SSL context
* \param pwd EC J-PAKE opaque password
*
* \return 0 on success, or a negative error code.
*/
int mbedtls_ssl_set_hs_ecjpake_password_opaque( mbedtls_ssl_context *ssl,
mbedtls_svc_key_id_t pwd );
#endif /*MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED */
#if defined(MBEDTLS_SSL_ALPN)