forked from wolfSSL/wolfssl
IoT-SAFE: Minor fixes
- reverted length change in put public operation - Loading CA from IoT-SAFE file slot in 16bit demo
This commit is contained in:
@ -192,6 +192,8 @@ static int client_loop(void)
|
|||||||
}
|
}
|
||||||
printf("Loaded Server CA from IoT-Safe, size = %lu\n",
|
printf("Loaded Server CA from IoT-Safe, size = %lu\n",
|
||||||
cert_buffer_size);
|
cert_buffer_size);
|
||||||
|
ret = wolfSSL_CTX_load_verify_buffer(cli_ctx, cert_buffer,
|
||||||
|
cert_buffer_size, WOLFSSL_FILETYPE_ASN1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,17 +40,13 @@
|
|||||||
#define CRT_SERVER_FILE_ID 0x3330
|
#define CRT_SERVER_FILE_ID 0x3330
|
||||||
#define PRIVKEY_ID 0x3230 /* pre-provisioned */
|
#define PRIVKEY_ID 0x3230 /* pre-provisioned */
|
||||||
#define ECDH_KEYPAIR_ID 0x3330
|
#define ECDH_KEYPAIR_ID 0x3330
|
||||||
#define PEER_PUBKEY_ID 0x3430
|
#define PEER_PUBKEY_ID 0x3530
|
||||||
#define PEER_CERT_ID 0x3530
|
#define PEER_CERT_ID 0x3430
|
||||||
|
|
||||||
/* In this version of the demo, the server certificate is
|
/* 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
|
* stored in a buffer, while the CA is read from a file slot in IoT-SAFE
|
||||||
*/
|
*/
|
||||||
#define SOFT_SERVER_CERT
|
#define SOFT_SERVER_CERT
|
||||||
|
|
||||||
/* DELME */
|
|
||||||
#define SOFT_SERVER_CA
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define IOTSAFE_ID_SIZE 1
|
#define IOTSAFE_ID_SIZE 1
|
||||||
#define CRT_CLIENT_FILE_ID 0x03 /* pre-provisioned */
|
#define CRT_CLIENT_FILE_ID 0x03 /* pre-provisioned */
|
||||||
|
@ -627,8 +627,8 @@ static int iotsafe_put_public_key(byte *pubkey_id, unsigned long id_size,
|
|||||||
|
|
||||||
/* Export raw Qx, Qy values */
|
/* Export raw Qx, Qy values */
|
||||||
ret = wc_ecc_export_public_raw(key,
|
ret = wc_ecc_export_public_raw(key,
|
||||||
ecc_pub_raw + 4 + id_size, &qxlen,
|
ecc_pub_raw + 5, &qxlen,
|
||||||
ecc_pub_raw + 4 + id_size + IOTSAFE_ECC_KSIZE, &qylen);
|
ecc_pub_raw + 5 + IOTSAFE_ECC_KSIZE, &qylen);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
WOLFSSL_MSG("IoT Safe: Could not export public key: Error");
|
WOLFSSL_MSG("IoT Safe: Could not export public key: Error");
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user