/*************************************************************************** * 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 */ /** */ /** Datagram Transport Layer Security (DTLS) */ /** */ /**************************************************************************/ /**************************************************************************/ #define NX_SECURE_SOURCE_CODE #include "nx_secure_dtls.h" /**************************************************************************/ /* */ /* FUNCTION RELEASE */ /* */ /* _nxe_secure_dtls_session_trusted_certificate_remove PORTABLE C */ /* 6.1 */ /* AUTHOR */ /* */ /* Timothy Stapko, Microsoft Corporation */ /* */ /* DESCRIPTION */ /* */ /* This function checks for errors when removing a trusted certificate */ /* from a DTLS session. */ /* */ /* INPUT */ /* */ /* dtls_session DTLS session control block */ /* common_name Certificate common name */ /* common_name_length Length of common name string */ /* cert_id Numeric ID for certificate */ /* */ /* OUTPUT */ /* */ /* status Completion status */ /* */ /* CALLS */ /* */ /* _nx_secure_dtls_session_trusted_certificate_remove */ /* Actual function 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_dtls_session_trusted_certificate_remove(NX_SECURE_DTLS_SESSION *dtls_session, UCHAR *common_name, UINT common_name_length, UINT cert_id) { #ifdef NX_SECURE_ENABLE_DTLS UINT status; if (dtls_session == NX_NULL) { return(NX_PTR_ERROR); } /* Make sure the session is initialized. */ if (dtls_session->nx_secure_dtls_tls_session.nx_secure_tls_id != NX_SECURE_TLS_ID) { return(NX_SECURE_TLS_SESSION_UNINITIALIZED); } /* Call the actual function. */ status = _nx_secure_dtls_session_trusted_certificate_remove(dtls_session, common_name, common_name_length, cert_id); return(status); #else NX_PARAMETER_NOT_USED(dtls_session); NX_PARAMETER_NOT_USED(common_name); NX_PARAMETER_NOT_USED(common_name_length); NX_PARAMETER_NOT_USED(cert_id); return(NX_NOT_SUPPORTED); #endif /* NX_SECURE_ENABLE_DTLS */ }