/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * Copyright (c) 2025-present Eclipse ThreadX Contributors * * This program and the accompanying materials are made available under the * terms of the MIT License which is available at * https://opensource.org/licenses/MIT. * * SPDX-License-Identifier: MIT **************************************************************************/ /**************************************************************************/ /**************************************************************************/ /** */ /** NetX Secure Component */ /** */ /** Transport Layer Security (TLS) */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SECURE_SOURCE_CODE /* Include necessary system files. */ #include "nx_secure_tls.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nx_secure_tls_session_alert_value_get PORTABLE C */ /* 6.4.3 */ /* AUTHOR */ /* */ /* Timothy Stapko, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function checks for errors in the TLS alert value */ /* informational API. */ /* */ /* INPUT */ /* */ /* tls_session Pointer to TLS Session */ /* alert_value Return alert value */ /* alert_level Return alert level */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* None */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /**************************************************************************/ UINT _nx_secure_tls_session_alert_value_get(NX_SECURE_TLS_SESSION *tls_session, UINT *alert_level, UINT *alert_value) { /* Get the protection. */ tx_mutex_get(&_nx_secure_tls_protection, TX_WAIT_FOREVER); /* Return the current alert value and level to the caller. */ *(alert_value) = tls_session -> nx_secure_tls_received_alert_value; *(alert_level) = tls_session -> nx_secure_tls_received_alert_level; /* Release the protection. */ tx_mutex_put(&_nx_secure_tls_protection); /* Return completion status. */ return(NX_SUCCESS); }