mirror of https://github.com/wolfSSL/wolfssl.git
IoT-SAFE: allow for 4B ID fields
parent
9db20774d8
commit
bda44eda4a
|
@ -146,9 +146,12 @@ static int client_loop(void)
|
||||||
#if (IOTSAFE_ID_SIZE == 1)
|
#if (IOTSAFE_ID_SIZE == 1)
|
||||||
byte cert_file_id, privkey_id, keypair_id, peer_pubkey_id, peer_cert_id, serv_cert_id;
|
byte cert_file_id, privkey_id, keypair_id, peer_pubkey_id, peer_cert_id, serv_cert_id;
|
||||||
byte ca_cert_id;
|
byte ca_cert_id;
|
||||||
#else
|
#elif (IOTSAFE_ID_SIZE == 2)
|
||||||
word16 cert_file_id, privkey_id, keypair_id, peer_pubkey_id, peer_cert_id, serv_cert_id;
|
word16 cert_file_id, privkey_id, keypair_id, peer_pubkey_id, peer_cert_id, serv_cert_id;
|
||||||
word16 ca_cert_id;
|
word16 ca_cert_id;
|
||||||
|
#else
|
||||||
|
word32 cert_file_id, privkey_id, keypair_id, peer_pubkey_id, peer_cert_id, serv_cert_id;
|
||||||
|
word32 ca_cert_id;
|
||||||
#endif
|
#endif
|
||||||
cert_file_id = CRT_CLIENT_FILE_ID;
|
cert_file_id = CRT_CLIENT_FILE_ID;
|
||||||
privkey_id = PRIVKEY_ID;
|
privkey_id = PRIVKEY_ID;
|
||||||
|
|
|
@ -34,7 +34,21 @@
|
||||||
* - Default: one-byte ID sim, with hardcoded server certificate
|
* - Default: one-byte ID sim, with hardcoded server certificate
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef TWO_BYTES_ID_DEMO
|
#if defined(FOUR_BYTES_ID_DEMO)
|
||||||
|
#define IOTSAFE_ID_SIZE 2
|
||||||
|
#define CRT_CLIENT_FILE_ID 0xABCD3430 /* pre-provisioned */
|
||||||
|
#define CRT_SERVER_FILE_ID 0xABCD3330
|
||||||
|
#define PRIVKEY_ID 0xABCD3230 /* pre-provisioned */
|
||||||
|
#define ECDH_KEYPAIR_ID 0xABCD3330
|
||||||
|
#define PEER_PUBKEY_ID 0xABCD3730
|
||||||
|
#define PEER_CERT_ID 0xABCD3430
|
||||||
|
|
||||||
|
/* In this version of the demo, the server certificate is
|
||||||
|
* stored in a buffer, while the CA is read from a file slot in IoT-SAFE
|
||||||
|
*/
|
||||||
|
#define SOFT_SERVER_CERT
|
||||||
|
|
||||||
|
#elif defined(TWO_BYTES_ID_DEMO)
|
||||||
#define IOTSAFE_ID_SIZE 2
|
#define IOTSAFE_ID_SIZE 2
|
||||||
#define CRT_CLIENT_FILE_ID 0x3430 /* pre-provisioned */
|
#define CRT_CLIENT_FILE_ID 0x3430 /* pre-provisioned */
|
||||||
#define CRT_SERVER_FILE_ID 0x3330
|
#define CRT_SERVER_FILE_ID 0x3330
|
||||||
|
|
|
@ -93,6 +93,11 @@ struct wc_IOTSAFE {
|
||||||
word16 ecdh_keypair_slot;
|
word16 ecdh_keypair_slot;
|
||||||
word16 peer_pubkey_slot;
|
word16 peer_pubkey_slot;
|
||||||
word16 peer_cert_slot;
|
word16 peer_cert_slot;
|
||||||
|
#elif (IOTSAFE_ID_SIZE == 4)
|
||||||
|
word32 privkey_id;
|
||||||
|
word32 ecdh_keypair_slot;
|
||||||
|
word32 peer_pubkey_slot;
|
||||||
|
word32 peer_cert_slot;
|
||||||
#else
|
#else
|
||||||
#error "IOTSAFE: ID_SIZE not supported"
|
#error "IOTSAFE: ID_SIZE not supported"
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue