DeepCover Embedded Security in IoT: Public-key Secured Data Paths

Dependencies:   MaximInterface

The MAXREFDES155# is an internet-of-things (IoT) embedded-security reference design, built to authenticate and control a sensing node using elliptic-curve-based public-key cryptography with control and notification from a web server.

The hardware includes an ARM® mbed™ shield and attached sensor endpoint. The shield contains a DS2476 DeepCover® ECDSA/SHA-2 coprocessor, Wifi communication, LCD push-button controls, and status LEDs. The sensor endpoint is attached to the shield using a 300mm cable and contains a DS28C36 DeepCover ECDSA/SHA-2 authenticator, IR-thermal sensor, and aiming laser for the IR sensor. The MAXREFDES155# is equipped with a standard Arduino® form-factor shield connector for immediate testing using an mbed board such as the MAX32600MBED#. The combination of these two devices represent an IoT device. Communication to the web server is accomplished with the shield Wifi circuitry. Communication from the shield to the attached sensor module is accomplished over I2C . The sensor module represents an IoT endpoint that generates small data with a requirement for message authenticity/integrity and secure on/off operational control.

The design is hierarchical with each mbed platform and shield communicating data from the sensor node to a web server that maintains a centralized log and dispatches notifications as necessary. The simplicity of this design enables rapid integration into any star-topology IoT network to provide security with the low overhead and cost provided by the ECDSA-P256 asymmetric-key and SHA-256 symmetric-key algorithms.

More information about the MAXREFDES155# is available on the Maxim Integrated website.

Committer:
IanBenzMaxim
Date:
Thu Oct 03 11:40:13 2019 -0500
Revision:
16:a004191a79ab
Parent:
simplelink/source/netcfg.c@0:33d4e66780c0
Updated MaximInterface to version 2.0. Updated mbed-os to version 5.5.7. Cleaned up code styling.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
IanBenzMaxim 0:33d4e66780c0 1 /*
IanBenzMaxim 0:33d4e66780c0 2 * netcfg.c - CC31xx/CC32xx Host Driver Implementation
IanBenzMaxim 0:33d4e66780c0 3 *
IanBenzMaxim 0:33d4e66780c0 4 * Copyright (C) 2015 Texas Instruments Incorporated - http://www.ti.com/
IanBenzMaxim 0:33d4e66780c0 5 *
IanBenzMaxim 0:33d4e66780c0 6 *
IanBenzMaxim 0:33d4e66780c0 7 * Redistribution and use in source and binary forms, with or without
IanBenzMaxim 0:33d4e66780c0 8 * modification, are permitted provided that the following conditions
IanBenzMaxim 0:33d4e66780c0 9 * are met:
IanBenzMaxim 0:33d4e66780c0 10 *
IanBenzMaxim 0:33d4e66780c0 11 * Redistributions of source code must retain the above copyright
IanBenzMaxim 0:33d4e66780c0 12 * notice, this list of conditions and the following disclaimer.
IanBenzMaxim 0:33d4e66780c0 13 *
IanBenzMaxim 0:33d4e66780c0 14 * Redistributions in binary form must reproduce the above copyright
IanBenzMaxim 0:33d4e66780c0 15 * notice, this list of conditions and the following disclaimer in the
IanBenzMaxim 0:33d4e66780c0 16 * documentation and/or other materials provided with the
IanBenzMaxim 0:33d4e66780c0 17 * distribution.
IanBenzMaxim 0:33d4e66780c0 18 *
IanBenzMaxim 0:33d4e66780c0 19 * Neither the name of Texas Instruments Incorporated nor the names of
IanBenzMaxim 0:33d4e66780c0 20 * its contributors may be used to endorse or promote products derived
IanBenzMaxim 0:33d4e66780c0 21 * from this software without specific prior written permission.
IanBenzMaxim 0:33d4e66780c0 22 *
IanBenzMaxim 0:33d4e66780c0 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
IanBenzMaxim 0:33d4e66780c0 24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
IanBenzMaxim 0:33d4e66780c0 26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
IanBenzMaxim 0:33d4e66780c0 27 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
IanBenzMaxim 0:33d4e66780c0 28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
IanBenzMaxim 0:33d4e66780c0 29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
IanBenzMaxim 0:33d4e66780c0 30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
IanBenzMaxim 0:33d4e66780c0 31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
IanBenzMaxim 0:33d4e66780c0 32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
IanBenzMaxim 0:33d4e66780c0 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
IanBenzMaxim 0:33d4e66780c0 34 *
IanBenzMaxim 0:33d4e66780c0 35 */
IanBenzMaxim 0:33d4e66780c0 36
IanBenzMaxim 0:33d4e66780c0 37
IanBenzMaxim 0:33d4e66780c0 38
IanBenzMaxim 0:33d4e66780c0 39 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 40 /* Include files */
IanBenzMaxim 0:33d4e66780c0 41 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 42 #include "simplelink.h"
IanBenzMaxim 0:33d4e66780c0 43 #include "protocol.h"
IanBenzMaxim 0:33d4e66780c0 44 #include "driver.h"
IanBenzMaxim 0:33d4e66780c0 45
IanBenzMaxim 0:33d4e66780c0 46 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 47 /* sl_NetCfgSet */
IanBenzMaxim 0:33d4e66780c0 48 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 49 typedef union
IanBenzMaxim 0:33d4e66780c0 50 {
IanBenzMaxim 0:33d4e66780c0 51 _NetCfgSetGet_t Cmd;
IanBenzMaxim 0:33d4e66780c0 52 _BasicResponse_t Rsp;
IanBenzMaxim 0:33d4e66780c0 53 }_SlNetCfgMsgSet_u;
IanBenzMaxim 0:33d4e66780c0 54
IanBenzMaxim 0:33d4e66780c0 55 #if _SL_INCLUDE_FUNC(sl_NetCfgSet)
IanBenzMaxim 0:33d4e66780c0 56
IanBenzMaxim 0:33d4e66780c0 57 static const _SlCmdCtrl_t _SlNetCfgSetCmdCtrl =
IanBenzMaxim 0:33d4e66780c0 58 {
IanBenzMaxim 0:33d4e66780c0 59 SL_OPCODE_DEVICE_NETCFG_SET_COMMAND,
IanBenzMaxim 0:33d4e66780c0 60 (_SlArgSize_t)sizeof(_NetCfgSetGet_t),
IanBenzMaxim 0:33d4e66780c0 61 (_SlArgSize_t)sizeof(_BasicResponse_t)
IanBenzMaxim 0:33d4e66780c0 62 };
IanBenzMaxim 0:33d4e66780c0 63
IanBenzMaxim 0:33d4e66780c0 64 _i32 sl_NetCfgSet(const _u8 ConfigId ,const _u8 ConfigOpt,const _u8 ConfigLen,const _u8 *pValues)
IanBenzMaxim 0:33d4e66780c0 65 {
IanBenzMaxim 0:33d4e66780c0 66 _SlNetCfgMsgSet_u Msg;
IanBenzMaxim 0:33d4e66780c0 67 _SlCmdExt_t CmdExt;
IanBenzMaxim 0:33d4e66780c0 68
IanBenzMaxim 0:33d4e66780c0 69 /* verify no erorr handling in progress. if in progress than
IanBenzMaxim 0:33d4e66780c0 70 ignore the API execution and return immediately with an error */
IanBenzMaxim 0:33d4e66780c0 71 VERIFY_NO_ERROR_HANDLING_IN_PROGRESS();
IanBenzMaxim 0:33d4e66780c0 72
IanBenzMaxim 0:33d4e66780c0 73 _SlDrvResetCmdExt(&CmdExt);
IanBenzMaxim 0:33d4e66780c0 74 CmdExt.TxPayloadLen = (ConfigLen+3) & (~3);
IanBenzMaxim 0:33d4e66780c0 75 CmdExt.pTxPayload = (_u8 *)pValues;
IanBenzMaxim 0:33d4e66780c0 76
IanBenzMaxim 0:33d4e66780c0 77
IanBenzMaxim 0:33d4e66780c0 78 Msg.Cmd.ConfigId = ConfigId;
IanBenzMaxim 0:33d4e66780c0 79 Msg.Cmd.ConfigLen = ConfigLen;
IanBenzMaxim 0:33d4e66780c0 80 Msg.Cmd.ConfigOpt = ConfigOpt;
IanBenzMaxim 0:33d4e66780c0 81
IanBenzMaxim 0:33d4e66780c0 82 VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetCfgSetCmdCtrl, &Msg, &CmdExt));
IanBenzMaxim 0:33d4e66780c0 83
IanBenzMaxim 0:33d4e66780c0 84 return (_i16)Msg.Rsp.status;
IanBenzMaxim 0:33d4e66780c0 85 }
IanBenzMaxim 0:33d4e66780c0 86 #endif
IanBenzMaxim 0:33d4e66780c0 87
IanBenzMaxim 0:33d4e66780c0 88
IanBenzMaxim 0:33d4e66780c0 89 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 90 /* sl_NetCfgGet */
IanBenzMaxim 0:33d4e66780c0 91 /*****************************************************************************/
IanBenzMaxim 0:33d4e66780c0 92 typedef union
IanBenzMaxim 0:33d4e66780c0 93 {
IanBenzMaxim 0:33d4e66780c0 94 _NetCfgSetGet_t Cmd;
IanBenzMaxim 0:33d4e66780c0 95 _NetCfgSetGet_t Rsp;
IanBenzMaxim 0:33d4e66780c0 96 }_SlNetCfgMsgGet_u;
IanBenzMaxim 0:33d4e66780c0 97
IanBenzMaxim 0:33d4e66780c0 98 #if _SL_INCLUDE_FUNC(sl_NetCfgGet)
IanBenzMaxim 0:33d4e66780c0 99
IanBenzMaxim 0:33d4e66780c0 100 static const _SlCmdCtrl_t _SlNetCfgGetCmdCtrl =
IanBenzMaxim 0:33d4e66780c0 101 {
IanBenzMaxim 0:33d4e66780c0 102 SL_OPCODE_DEVICE_NETCFG_GET_COMMAND,
IanBenzMaxim 0:33d4e66780c0 103 (_SlArgSize_t)sizeof(_NetCfgSetGet_t),
IanBenzMaxim 0:33d4e66780c0 104 (_SlArgSize_t)sizeof(_NetCfgSetGet_t)
IanBenzMaxim 0:33d4e66780c0 105 };
IanBenzMaxim 0:33d4e66780c0 106
IanBenzMaxim 0:33d4e66780c0 107 _i32 sl_NetCfgGet(const _u8 ConfigId, _u8 *pConfigOpt,_u8 *pConfigLen, _u8 *pValues)
IanBenzMaxim 0:33d4e66780c0 108 {
IanBenzMaxim 0:33d4e66780c0 109 _SlNetCfgMsgGet_u Msg;
IanBenzMaxim 0:33d4e66780c0 110 _SlCmdExt_t CmdExt;
IanBenzMaxim 0:33d4e66780c0 111
IanBenzMaxim 0:33d4e66780c0 112 /* verify no erorr handling in progress. if in progress than
IanBenzMaxim 0:33d4e66780c0 113 ignore the API execution and return immediately with an error */
IanBenzMaxim 0:33d4e66780c0 114 VERIFY_NO_ERROR_HANDLING_IN_PROGRESS();
IanBenzMaxim 0:33d4e66780c0 115
IanBenzMaxim 0:33d4e66780c0 116 if (*pConfigLen == 0)
IanBenzMaxim 0:33d4e66780c0 117 {
IanBenzMaxim 0:33d4e66780c0 118 return SL_EZEROLEN;
IanBenzMaxim 0:33d4e66780c0 119 }
IanBenzMaxim 0:33d4e66780c0 120
IanBenzMaxim 0:33d4e66780c0 121 _SlDrvResetCmdExt(&CmdExt);
IanBenzMaxim 0:33d4e66780c0 122 CmdExt.RxPayloadLen = (_i16)(*pConfigLen);
IanBenzMaxim 0:33d4e66780c0 123 CmdExt.pRxPayload = (_u8 *)pValues;
IanBenzMaxim 0:33d4e66780c0 124 Msg.Cmd.ConfigLen = *pConfigLen;
IanBenzMaxim 0:33d4e66780c0 125 Msg.Cmd.ConfigId = ConfigId;
IanBenzMaxim 0:33d4e66780c0 126
IanBenzMaxim 0:33d4e66780c0 127 if( pConfigOpt )
IanBenzMaxim 0:33d4e66780c0 128 {
IanBenzMaxim 0:33d4e66780c0 129 Msg.Cmd.ConfigOpt = (_u16)*pConfigOpt;
IanBenzMaxim 0:33d4e66780c0 130 }
IanBenzMaxim 0:33d4e66780c0 131 VERIFY_RET_OK(_SlDrvCmdOp((_SlCmdCtrl_t *)&_SlNetCfgGetCmdCtrl, &Msg, &CmdExt));
IanBenzMaxim 0:33d4e66780c0 132
IanBenzMaxim 0:33d4e66780c0 133 if( pConfigOpt )
IanBenzMaxim 0:33d4e66780c0 134 {
IanBenzMaxim 0:33d4e66780c0 135 *pConfigOpt = (_u8)Msg.Rsp.ConfigOpt;
IanBenzMaxim 0:33d4e66780c0 136 }
IanBenzMaxim 0:33d4e66780c0 137 if (CmdExt.RxPayloadLen < CmdExt.ActualRxPayloadLen)
IanBenzMaxim 0:33d4e66780c0 138 {
IanBenzMaxim 0:33d4e66780c0 139 *pConfigLen = (_u8)CmdExt.RxPayloadLen;
IanBenzMaxim 0:33d4e66780c0 140 if( SL_MAC_ADDRESS_GET == ConfigId )
IanBenzMaxim 0:33d4e66780c0 141 {
IanBenzMaxim 0:33d4e66780c0 142 return SL_RET_CODE_OK; /* sp fix */
IanBenzMaxim 0:33d4e66780c0 143 }
IanBenzMaxim 0:33d4e66780c0 144 else
IanBenzMaxim 0:33d4e66780c0 145 {
IanBenzMaxim 0:33d4e66780c0 146 return SL_ESMALLBUF;
IanBenzMaxim 0:33d4e66780c0 147 }
IanBenzMaxim 0:33d4e66780c0 148 }
IanBenzMaxim 0:33d4e66780c0 149 else
IanBenzMaxim 0:33d4e66780c0 150 {
IanBenzMaxim 0:33d4e66780c0 151 *pConfigLen = (_u8)CmdExt.ActualRxPayloadLen;
IanBenzMaxim 0:33d4e66780c0 152 }
IanBenzMaxim 0:33d4e66780c0 153
IanBenzMaxim 0:33d4e66780c0 154 return (_i32)Msg.Rsp.Status;
IanBenzMaxim 0:33d4e66780c0 155 }
IanBenzMaxim 0:33d4e66780c0 156 #endif
IanBenzMaxim 0:33d4e66780c0 157