Skip to content

Commit 411cd5c

Browse files
Python JWT and config additions. Secure boot update.
1 parent 2044ad9 commit 411cd5c

File tree

885 files changed

+50477
-50731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

885 files changed

+50477
-50731
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ Examples
6060

6161
Release notes
6262
-----------
63+
01/25/2019
64+
- Python JWT support
65+
- Python configuration structures added
66+
- Restructure of secure boot app
67+
6368
01/04/2019
6469
- Added GCM functions
6570
- Split AES modes into separate files

app/secure_boot/crypto_device_app.c

Lines changed: 0 additions & 213 deletions
This file was deleted.

app/secure_boot/crypto_device_app.h

Lines changed: 0 additions & 56 deletions
This file was deleted.

app/secure_boot/secure_boot.c

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -223,19 +223,21 @@ static ATCA_STATUS secure_boot_calc_app_digest(secure_boot_parameters* secure_bo
223223

224224
return ATCA_SUCCESS;
225225
}
226-
227-
ATCA_STATUS check_device_io_protection_key_generate(void)
226+
/** \brief Binds host MCU and Secure element with IO protection key.
227+
* \param[in] slot The slot number of IO protection Key.
228+
* \return ATCA_SUCCESS on success, otherwise an error code.
229+
*/
230+
ATCA_STATUS bind_host_and_secure_element_with_io_protection(uint16_t slot)
228231
{
229232
bool is_locked;
230233
ATCA_STATUS status = ATCA_GEN_FAIL;
231234
uint8_t io_prot_key[ATCA_KEY_SIZE];
232235

233236
/*IO protection key is not on host... Get bind with device */
234-
235237
do
236238
{
237239
/* First check Lock status on device */
238-
if ((status = atcab_is_slot_locked(IO_PROTECTION_KEY_SLOT, &is_locked)) != ATCA_SUCCESS)
240+
if ((status = atcab_is_slot_locked(slot, &is_locked)) != ATCA_SUCCESS)
239241
{
240242
break;
241243
}
@@ -253,9 +255,8 @@ ATCA_STATUS check_device_io_protection_key_generate(void)
253255
break;
254256
}
255257

256-
257258
/*Load the random number as IO Protection key on the device */
258-
if ((status = atcab_write_zone(ATCA_ZONE_DATA, IO_PROTECTION_KEY_SLOT, 0, 0, io_prot_key, ATCA_KEY_SIZE)) != ATCA_SUCCESS)
259+
if ((status = atcab_write_zone(ATCA_ZONE_DATA, slot, 0, 0, io_prot_key, ATCA_KEY_SIZE)) != ATCA_SUCCESS)
259260
{
260261
break;
261262
}
@@ -267,12 +268,10 @@ ATCA_STATUS check_device_io_protection_key_generate(void)
267268
}
268269

269270
/*Lock IO protection key slot */
270-
if ((status = atcab_lock_data_slot(IO_PROTECTION_KEY_SLOT)) != ATCA_SUCCESS)
271+
if ((status = atcab_lock_data_slot(slot)) != ATCA_SUCCESS)
271272
{
272273
break;
273274
}
274-
275-
276275
}
277276
while (0);
278277

app/secure_boot/secure_boot.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,17 @@ extern "C" {
4545
#define SECURE_BOOT_CONFIG_FULL_SIGN 2
4646
#define SECURE_BOOT_CONFIG_FULL_DIG 3
4747

48+
#ifndef SECURE_BOOT_CONFIGURATION
4849
#define SECURE_BOOT_CONFIGURATION SECURE_BOOT_CONFIG_FULL_DIG
50+
#endif
51+
52+
#ifndef SECURE_BOOT_DIGEST_ENCRYPT_ENABLED
4953
#define SECURE_BOOT_DIGEST_ENCRYPT_ENABLED true
50-
#define SECURE_BOOT_UPGRADE_SUPPORT true
54+
#endif
5155

56+
#ifndef SECURE_BOOT_UPGRADE_SUPPORT
57+
#define SECURE_BOOT_UPGRADE_SUPPORT true
58+
#endif
5259

5360
typedef struct
5461
{
@@ -73,11 +80,8 @@ typedef struct
7380
#endif
7481
}secure_boot_parameters;
7582

76-
typedef ATCA_STATUS (*secure_boot_handler)(secure_boot_parameters* secure_boot_params);
77-
78-
7983
ATCA_STATUS secure_boot_process(void);
80-
ATCA_STATUS check_device_io_protection_key_generate(void);
84+
ATCA_STATUS bind_host_and_secure_element_with_io_protection(uint16_t slot);
8185
extern ATCA_STATUS host_generate_random_number(uint8_t *rand);
8286

8387
#ifdef __cplusplus

docs/html/a00011.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@
9595

9696
<p>Contains API for performing the symmetric Authentication between the Host and the device.
9797
<a href="#details">More...</a></p>
98-
<div class="textblock"><code>#include &quot;<a class="el" href="a00320_source.html">cryptoauthlib.h</a>&quot;</code><br />
99-
<code>#include &quot;<a class="el" href="a00545_source.html">host/atca_host.h</a>&quot;</code><br />
98+
<div class="textblock"><code>#include &quot;<a class="el" href="a00314_source.html">cryptoauthlib.h</a>&quot;</code><br />
99+
<code>#include &quot;<a class="el" href="a00539_source.html">host/atca_host.h</a>&quot;</code><br />
100100
<code>#include &quot;<a class="el" href="a00014_source.html">symmetric_authentication.h</a>&quot;</code><br />
101101
</div><table class="memberdecls">
102102
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
103103
Functions</h2></td></tr>
104-
<tr class="memitem:a9a41d1600ffd22de067ded50447d359b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00134.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00011.html#a9a41d1600ffd22de067ded50447d359b">symmetric_authenticate</a> (uint8_t slot, const uint8_t *master_key, const uint8_t *rand_number)</td></tr>
104+
<tr class="memitem:a9a41d1600ffd22de067ded50447d359b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00011.html#a9a41d1600ffd22de067ded50447d359b">symmetric_authenticate</a> (uint8_t slot, const uint8_t *master_key, const uint8_t *rand_number)</td></tr>
105105
<tr class="memdesc:a9a41d1600ffd22de067ded50447d359b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function which does the authentication between the host and device. <a href="#a9a41d1600ffd22de067ded50447d359b">More...</a><br /></td></tr>
106106
<tr class="separator:a9a41d1600ffd22de067ded50447d359b"><td class="memSeparator" colspan="2">&#160;</td></tr>
107107
</table>
@@ -116,7 +116,7 @@ <h2 class="memtitle"><span class="permalink"><a href="#a9a41d1600ffd22de067ded50
116116
<div class="memproto">
117117
<table class="memname">
118118
<tr>
119-
<td class="memname"><a class="el" href="a00134.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> symmetric_authenticate </td>
119+
<td class="memname"><a class="el" href="a00128.html#a22bd6643f31f1d75dc3e7ea939f468cd">ATCA_STATUS</a> symmetric_authenticate </td>
120120
<td>(</td>
121121
<td class="paramtype">uint8_t&#160;</td>
122122
<td class="paramname"><em>slot</em>, </td>

0 commit comments

Comments
 (0)