1 /***************************************************************************
2  * Copyright (c) 2024 Microsoft Corporation
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the MIT License which is available at
6  * https://opensource.org/licenses/MIT.
7  *
8  * SPDX-License-Identifier: MIT
9  **************************************************************************/
10 
11 
12 /**************************************************************************/
13 /**************************************************************************/
14 /**                                                                       */
15 /** NetX Secure Component                                                 */
16 /**                                                                       */
17 /**    Transport Layer Security (TLS)                                     */
18 /**                                                                       */
19 /**************************************************************************/
20 /**************************************************************************/
21 
22 #define NX_SECURE_SOURCE_CODE
23 
24 #include "nx_secure_tls.h"
25 
26 /**************************************************************************/
27 /*                                                                        */
28 /*  FUNCTION                                               RELEASE        */
29 /*                                                                        */
30 /*    _nx_secure_tls_key_material_init                    PORTABLE C      */
31 /*                                                           6.1.12       */
32 /*  AUTHOR                                                                */
33 /*                                                                        */
34 /*    Timothy Stapko, Microsoft Corporation                               */
35 /*                                                                        */
36 /*  DESCRIPTION                                                           */
37 /*                                                                        */
38 /*    This function initializes the key material used by a TLS session.   */
39 /*                                                                        */
40 /*  INPUT                                                                 */
41 /*                                                                        */
42 /*    key_material                          Pointer to key material data  */
43 /*                                                                        */
44 /*  OUTPUT                                                                */
45 /*                                                                        */
46 /*    status                                Completion status             */
47 /*                                                                        */
48 /*  CALLS                                                                 */
49 /*                                                                        */
50 /*    None                                                                */
51 /*                                                                        */
52 /*  CALLED BY                                                             */
53 /*                                                                        */
54 /*    _nx_secure_tls_session_reset          Clear out the session         */
55 /*                                                                        */
56 /*  RELEASE HISTORY                                                       */
57 /*                                                                        */
58 /*    DATE              NAME                      DESCRIPTION             */
59 /*                                                                        */
60 /*  05-19-2020     Timothy Stapko           Initial Version 6.0           */
61 /*  09-30-2020     Timothy Stapko           Modified comment(s),          */
62 /*                                            resulting in version 6.1    */
63 /*  07-29-2022     Yuxin Zhou               Modified comment(s),          */
64 /*                                            cleared all key material,   */
65 /*                                            resulting in version 6.1.12 */
66 /*                                                                        */
67 /**************************************************************************/
_nx_secure_tls_key_material_init(NX_SECURE_TLS_KEY_MATERIAL * key_material)68 UINT _nx_secure_tls_key_material_init(NX_SECURE_TLS_KEY_MATERIAL *key_material)
69 {
70 
71     /* Clear out the entire key material. */
72     NX_SECURE_MEMSET(key_material, 0, sizeof(NX_SECURE_TLS_KEY_MATERIAL));
73 
74     return(NX_SECURE_TLS_SUCCESS);
75 }
76 
77