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
Add Wi-Sun certificate options to mesh api configuration json #10598
Merged
Merged
Changes from 1 commit
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,9 @@ | |
#include "mac_api.h" | ||
#include "sw_mac.h" | ||
#include "ws_management_api.h" //ws_management_node_init | ||
#ifdef MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER | ||
#include MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER | ||
#endif | ||
|
||
// For tracing we need to define flag, have include and define group | ||
//#define HAVE_DEBUG | ||
|
@@ -210,6 +213,18 @@ static void wisun_tasklet_configure_and_connect_to_network(void) | |
network_name, | ||
fhss_timer_ptr); | ||
|
||
#if defined(MBED_CONF_MBED_MESH_API_CERTIFICATE_HEADER) | ||
arm_certificate_chain_entry_s chain_info; | ||
memset(&chain_info, 0, sizeof(arm_certificate_chain_entry_s)); | ||
chain_info.cert_chain[0] = (const uint8_t *) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE; | ||
chain_info.cert_len[0] = strlen((const char *) MBED_CONF_MBED_MESH_API_ROOT_CERTIFICATE) + 1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you check configuration validity at compile time to avoid hard fault caused by illegal configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check added |
||
chain_info.cert_chain[1] = (const uint8_t *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE; | ||
chain_info.cert_len[1] = strlen((const char *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE) + 1; | ||
chain_info.key_chain[1] = (const uint8_t *) MBED_CONF_MBED_MESH_API_OWN_CERTIFICATE_KEY; | ||
chain_info.chain_length = 2; | ||
arm_network_certificate_chain_set((const arm_certificate_chain_entry_s *) &chain_info); | ||
#endif | ||
|
||
status = arm_nwk_interface_up(wisun_tasklet_data_ptr->network_interface_id); | ||
if (status >= 0) { | ||
wisun_tasklet_data_ptr->tasklet_state = TASKLET_STATE_BOOTSTRAP_STARTED; | ||
|
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.
What is the type or range of the
value
field? Please document that as well.Others have already documentation.
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.
Corrected