-
-
Notifications
You must be signed in to change notification settings - Fork 120
Expose WPA2 enterprise APIs #33
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
Conversation
main/CommandHandler.cpp
Outdated
struct stat st; | ||
stat(key_filename, &st); | ||
size_t client_key_buf_size = st.st_size; | ||
uint8_t* client_key_buf = (uint8_t*)malloc(st.st_size); |
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.
Since this is stored in RAM anyways, do we need to store it in a file?
Also, should the buffer be freed if the API is called twice in a row?
size_t client_crt_buf_size = (command[3] << 8 | command[4]); | ||
size_t client_key_buf_size = (command[5] << 8 | command[6]); | ||
uint8_t* client_crt_buf = (uint8_t*)malloc(client_crt_buf_size + 1); | ||
uint8_t* client_key_buf = (uint8_t*)malloc(client_key_buf_size + 1); |
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.
Should this RAM be free'ed somewhere?
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.
Our use case is somehow particular since the certificates are usually in flash; after a successful connection is established they should not be useful but I'm not 100% sure.
Since our library resets the module upon attempting the first communication with it I think we can avoid freeing them probably.
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.
Ok, I'm still wondering if we should use realloc
instead of malloc
here, in case the sketch calls the lib side API twice in a row for whatever reason.
Closing in favour of #43. |
With certificates handling done in filesystem for persistency, need to be tested though