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
net: lwm2m: Add support for X509 certificates #59019
Merged
fabiobaltieri
merged 2 commits into
zephyrproject-rtos:main
from
SeppoTakalo:lwm2m_dtls_x509
Jun 26, 2023
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
CONFIG_LWM2M_DTLS_SUPPORT=y | ||
CONFIG_LWM2M_PEER_PORT=5684 | ||
|
||
# I need room to store certificates | ||
CONFIG_LWM2M_SECURITY_KEY_SIZE=2048 | ||
|
||
# Select Zephyr mbedtls | ||
CONFIG_MBEDTLS=y | ||
CONFIG_MBEDTLS_TLS_VERSION_1_2=y | ||
|
||
# Special MbedTLS changes | ||
CONFIG_MBEDTLS_ENABLE_HEAP=y | ||
CONFIG_MBEDTLS_HEAP_SIZE=32768 | ||
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=1500 | ||
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y | ||
|
||
# Disable RSA, use only ECC certificates | ||
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA_ENABLED=n | ||
# Enable PSK and ECDHE_ECDSA | ||
CONFIG_MBEDTLS_KEY_EXCHANGE_PSK_ENABLED=y | ||
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED=y | ||
# We only need prime256v1 curve | ||
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y | ||
CONFIG_MBEDTLS_ECDH_C=y | ||
CONFIG_MBEDTLS_ECDSA_C=y | ||
CONFIG_MBEDTLS_ECP_C=y | ||
CONFIG_MBEDTLS_CIPHER_CCM_ENABLED=y | ||
CONFIG_MBEDTLS_CIPHER_GCM_ENABLED=y | ||
# Optional: we could use just binary DER certificates | ||
CONFIG_MBEDTLS_PEM_CERTIFICATE_FORMAT=y | ||
|
||
CONFIG_NET_SOCKETS_SOCKOPT_TLS=y | ||
CONFIG_NET_SOCKETS_TLS_MAX_CONTEXTS=4 | ||
CONFIG_NET_SOCKETS_ENABLE_DTLS=y | ||
|
||
# MbedTLS needs a larger stack | ||
CONFIG_MAIN_STACK_SIZE=2048 | ||
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Shouldn't this overlay also enforce bootstrap? We're not feeding any certificates from the application.
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.
Not necessary.. I was testing this manually by feeding the certificates from command line.
I prefer to write separate documentation as there are now 3 different security modes supported. But I would like to do that on another commit.
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.
Yes, an update in the documentation would be much appreciated. I'm ok with doing this separately.