Remove useless duplicted mbedtls_ssl_tls13_ticket_get_psk
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
854db28bb7
commit
7094f66879
3 changed files with 1 additions and 35 deletions
|
@ -2629,13 +2629,6 @@ static inline int mbedtls_ssl_tls13_cipher_suite_is_offered(
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MBEDTLS_SSL_SESSION_TICKETS
|
|
||||||
int mbedtls_ssl_tls13_ticket_get_psk(mbedtls_ssl_context *ssl,
|
|
||||||
psa_algorithm_t *hash_alg,
|
|
||||||
const unsigned char **psk,
|
|
||||||
size_t *psk_len);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Validate cipher suite against config in SSL context.
|
* \brief Validate cipher suite against config in SSL context.
|
||||||
*
|
*
|
||||||
|
|
|
@ -975,7 +975,7 @@ int mbedtls_ssl_tls13_write_identities_of_pre_shared_key_ext(
|
||||||
ret = ssl_tls13_ticket_get_psk(ssl, &hash_alg, &psk, &psk_len);
|
ret = ssl_tls13_ticket_get_psk(ssl, &hash_alg, &psk, &psk_len);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
MBEDTLS_SSL_DEBUG_RET(
|
MBEDTLS_SSL_DEBUG_RET(
|
||||||
1, "mbedtls_ssl_tls13_ticket_get_psk", ret);
|
1, "ssl_tls13_ticket_get_psk", ret);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1574,31 +1574,4 @@ int mbedtls_ssl_tls13_check_received_extension(
|
||||||
return MBEDTLS_ERR_SSL_UNSUPPORTED_EXTENSION;
|
return MBEDTLS_ERR_SSL_UNSUPPORTED_EXTENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef MBEDTLS_SSL_SESSION_TICKETS
|
|
||||||
int mbedtls_ssl_tls13_ticket_get_psk(mbedtls_ssl_context *ssl,
|
|
||||||
psa_algorithm_t *hash_alg,
|
|
||||||
const unsigned char **psk,
|
|
||||||
size_t *psk_len)
|
|
||||||
{
|
|
||||||
|
|
||||||
mbedtls_ssl_session *session = ssl->session_negotiate;
|
|
||||||
const mbedtls_ssl_ciphersuite_t *ciphersuite_info = NULL;
|
|
||||||
|
|
||||||
if (ssl->handshake->resume == 0 || session == NULL ||
|
|
||||||
session->ticket == NULL) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
ciphersuite_info = mbedtls_ssl_ciphersuite_from_id(session->ciphersuite);
|
|
||||||
if (ciphersuite_info != NULL) {
|
|
||||||
*hash_alg = mbedtls_psa_translate_md(ciphersuite_info->mac);
|
|
||||||
}
|
|
||||||
|
|
||||||
*psk = session->resumption_key;
|
|
||||||
*psk_len = session->resumption_key_len;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif /* MBEDTLS_SSL_SESSION_TICKETS */
|
|
||||||
|
|
||||||
#endif /* MBEDTLS_SSL_TLS_C && MBEDTLS_SSL_PROTO_TLS1_3 */
|
#endif /* MBEDTLS_SSL_TLS_C && MBEDTLS_SSL_PROTO_TLS1_3 */
|
||||||
|
|
Loading…
Reference in a new issue