-
Notifications
You must be signed in to change notification settings - Fork 1
Implement SecureStore class #20
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
Make minor copy edits for active voice, branding and deletion of extra spaces.
Currently the following commands in examples.py, do_import() do_deploy() do_versionning() do_clone() all return a success status (ie 0) irrespective of any errors originating from their sub-functions. This PR fixes this. Now these commands will return one of: 0 - success 1 - general failure x - failure returned by a subprocess.call function
subprocess.call() does not by default return a status value. Update the commands to add shell=True which forces a return value. Also convert the commands to a single string rather than a list as this plays more nicely with both linux and windows. Also fix a spurious :
Transport is a member of TLSSocket which is derived from TLSSocketWrapper. Make sure that TLSSocketWrapper::close() is called before the transport is destroyed.
TCP and UDP sockets are automatically available when mbed.h is included in an application. This change lets the TLSSocket be used in the same way.
Remove _thread suffix and rename threads.
Simplify the document. More information is provided on our documentation portal, link it here
5d4a1bf
to
705c29e
Compare
Fix off-by-one-error in BusIn/Out
Remove unnecessary commas, and standardize heading capitalization.
Remove unnecessary comma.
Remove unnecessary comma.
Increase EMAC test timeout to 1400 seconds
Add get_erase_value() support
Add names to system thread
Rollup PR for docs
…lehto/mbed-os into rollup
…/mbed-os into rollup
…ed-os into rollup
…ed-os into rollup
Rollup PR: Docs + small fixes
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.
I reviewed securestore cpp and h
Fantastic Job!
goto fail; | ||
} | ||
auth_started = true; | ||
// Although key is not part of the data, we calculate CMAC on it as well |
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.
// Although name is not part of the data, we calculate CMAC on it as well
static const uint32_t enc_block_size = 16; | ||
static const uint32_t cmac_size = 16; | ||
static const uint32_t iv_size = 8; | ||
static const uint32_t scratch_buf_size = 32; |
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.
you can use a bigger buffer, maybe 256 bytes
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.
Good idea. Will check whether this has any effect on performance.
} | ||
auth_started = true; | ||
|
||
// Although key is not part of the data, we calculate CMAC on it as well |
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.
key-->name
"macros": ["MBEDTLS_CIPHER_MODE_CTR", "MBEDTLS_CMAC_C"], | ||
"config": { | ||
} | ||
} |
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.
Something strange at the end of this file
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.
All I need here is to have the cipher and CMAC defines set. Nothing needed in the config.
There is a strange character at the end of the file... |
Fixed all issues. Enlarging the scratch buffer indeed helped with the performance, but that's just because there were less calls to TDBStore. Seems like TDBStore is the problem. |
705c29e
to
a54c939
Compare
a54c939
to
4b6a2fe
Compare
ARMC5 failed to compile the code with debug-profile (!!) as va_list is getting into std:: namespace when one includes <cstdarg>. Other compilers seem to be more relaxed, and so is ARMC5 if compiled with other profiles. Add the explicit std:: to references of va_list. While here, remove one extra copy of "#include "PlatformMutex.h"" and a "#include <stdarg.h>" which is kind of duplicate of "#include <cstdarg>". Error being fixed: --8<--8<--8<-- Compile [ 81.8%]: ATHandler.cpp [Error] ATHandler.h@552,0: #20: identifier "va_list" is undefined [Error] ATHandler.cpp@1226,0: ARMmbed#147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, <error-type>)" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h") [ERROR] "./mbed-os/features/cellular/framework/AT/ATHandler.h", line 552: Error: #20: identifier "va_list" is undefined "./mbed-os/features/cellular/framework/AT/ATHandler.cpp", line 1226: Error: ARMmbed#147: declaration is incompatible with "void mbed::ATHandler::handle_args(const char *, <error-type>)" (declared at line 552 of "./mbed-os/features/cellular/framework/AT/ATHandler.h") ./mbed-os/features/cellular/framework/AT/ATHandler.cpp: 0 warnings, 2 errors
Implement SecureStore class.
@dannybenor @yossi2le @offirko @theamirocohen Please review.