Skip to content
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

Closed
wants to merge 4 commits into from
Closed

Iris 5723 nrf jwt #8

wants to merge 4 commits into from

Conversation

jayteemo
Copy link
Owner

No description provided.

/* Find and remove end string */
end = strstr(str, END_PRV_KEY);
if (end == NULL) {
return -EINVAL;
Copy link
Collaborator

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 */
Copy link
Collaborator

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

Comment on lines +158 to +176
#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
Copy link
Collaborator

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

@jayteemo jayteemo closed this Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants