-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Iris 5723 nrf jwt #8
Conversation
Signed-off-by: Justin Morton <[email protected]>
Signed-off-by: Justin Morton <[email protected]>
Signed-off-by: Justin Morton <[email protected]>
/* Find and remove end string */ | ||
end = strstr(str, END_PRV_KEY); | ||
if (end == NULL) { | ||
return -EINVAL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail for non-PEM credentials, which we may or may not want to have at our disposal. It saves RAM, at least
} | ||
memcpy(pem, private_key, pem_sz); | ||
#else | ||
/* Get the private key from protected storage */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth noting: Whether it comes from protected storage depends on the backend being used with the TLS credentials module
#if defined(CONFIG_NRF_CLOUD_COAP_WIFI_ADD_CREDS_FROM_FILE) | ||
err = tls_credential_add(CONFIG_NRF_CLOUD_SEC_TAG, | ||
TLS_CREDENTIAL_CA_CERTIFICATE, | ||
ca_certificate, | ||
sizeof(ca_certificate)); | ||
if (err < 0) { | ||
LOG_ERR("Failed to add CA certificate: %d", err); | ||
|
||
} | ||
|
||
err = tls_credential_add(CONFIG_NRF_CLOUD_SEC_TAG, | ||
TLS_CREDENTIAL_PRIVATE_KEY, | ||
private_key, | ||
sizeof(private_key)); | ||
if (err < 0) { | ||
LOG_ERR("Failed to add private key: %d", err); | ||
} | ||
|
||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we already have CONFIG_NRF_CLOUD_PROVISION_CERTIFICATES
which does nearly the same thing
It would be nice if we could just alter/extend that to work for CoAP
Or at least re-use the KConfig Symbol
No description provided.