Skip to content

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

Closed
wants to merge 65 commits into from
Closed

Conversation

davidsaada
Copy link
Owner

Implement SecureStore class.
@dannybenor @yossi2le @offirko @theamirocohen Please review.

SenRamakri and others added 30 commits October 29, 2018 13:47
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
Cruz Monrreal and others added 15 commits November 6, 2018 13:43
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
Rollup PR: Docs + small fixes
Copy link
Collaborator

@dannybenor dannybenor left a 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
Copy link
Collaborator

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;
Copy link
Collaborator

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

Copy link
Owner Author

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

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": {
}
}
Copy link
Collaborator

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

Copy link
Owner Author

@davidsaada davidsaada Nov 7, 2018

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.

@dannybenor
Copy link
Collaborator

There is a strange character at the end of the file...

@davidsaada
Copy link
Owner Author

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.

@davidsaada davidsaada closed this Nov 7, 2018
@davidsaada davidsaada deleted the david_securestore branch December 6, 2018 13:05
davidsaada pushed a commit that referenced this pull request Dec 31, 2018
davidsaada pushed a commit that referenced this pull request Jul 2, 2019
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.