/*************************************************************************** * Copyright (c) 2024 Microsoft Corporation * * 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 */ /* */ /* _nxe_secure_tls_session_alert_value_get PORTABLE C */ /* 6.1 */ /* 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 */ /* */ /* _nx_secure_tls_session_alert_value_get */ /* Actual API call */ /* */ /* CALLED BY */ /* */ /* Application Code */ /* */ /* RELEASE HISTORY */ /* */ /* DATE NAME DESCRIPTION */ /* */ /* 05-19-2020 Timothy Stapko Initial Version 6.0 */ /* 09-30-2020 Timothy Stapko Modified comment(s), */ /* resulting in version 6.1 */ /* */ /**************************************************************************/ UINT _nxe_secure_tls_session_alert_value_get(NX_SECURE_TLS_SESSION *tls_session, UINT *alert_level, UINT *alert_value) { UINT status; if (tls_session == NX_NULL || alert_level == NX_NULL || alert_value == NX_NULL) { return(NX_PTR_ERROR); } /* Make sure the session is initialized. */ if(tls_session -> nx_secure_tls_id != NX_SECURE_TLS_ID) { return(NX_SECURE_TLS_SESSION_UNINITIALIZED); } status = _nx_secure_tls_session_alert_value_get(tls_session, alert_level, alert_value); /* Return completion status. */ return(status); }