-
Notifications
You must be signed in to change notification settings - Fork 6
Crypto refactoring #382
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
base: feature_unification
Are you sure you want to change the base?
Crypto refactoring #382
Conversation
/** | ||
* Random generator interface. | ||
*/ | ||
class RandomItf { |
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 RandomItf be moved to a dedicated header (like HashItf for example)
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.
decided to leave small interfaces inside crypto.hpp, to decrease the amount of files
but that's the open point for now
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.
RandomItf should be placed in a separate file because it can be used standalone. You can keep aes interface with crypto, because it can be used without it.
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.
done
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## feature_unification #382 +/- ##
====================================================
Coverage 81.65% 81.65%
====================================================
Files 201 208 +7
Lines 21959 21960 +1
Branches 3053 3052 -1
====================================================
+ Hits 17931 17932 +1
Misses 4028 4028 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Reviewed-by: Mykhailo Lohvynenko <[email protected]>
4523069
to
7e2cc45
Compare
We need to add basic design document with at least purpose description of each interface. I don't think we would be able to close full crypto design document soon. |
@@ -1,4 +1,5 @@ | |||
build/* | |||
.vscode/* | |||
.cache/* |
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 produced this folder?
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.
it is produced by clangd server
/** | ||
* Random generator interface. | ||
*/ | ||
class RandomItf { |
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.
RandomItf should be placed in a separate file because it can be used standalone. You can keep aes interface with crypto, because it can be used without it.
d07756d
to
f523031
Compare
/*** | ||
* UUID generator interface. | ||
*/ | ||
class UUIDItf { |
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 guess UUID should be in separate header 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.
done
/** | ||
* AES cipher interface for 16-byte block encryption/decryption. | ||
*/ | ||
class AESCipherItf { |
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.
And AES as well in separate aes.hpp
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.
done
#define AOS_CORE_CM_STORAGESTATE_STORAGESTATE_HPP_ | ||
|
||
#include <core/common/crypto/crypto.hpp> | ||
#include <core/common/crypto/itf/crypto.hpp> |
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.
it looks like storagestate should you only hash itf
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.
indeed, fixed.
* [aos::fs::FSPlatformItf](../../common/tools/fs.hpp) - handle filesystem operations; | ||
* [aos::fs::FSWatcherItf](../../common/tools/fs.hpp) - subscribes to file change events. | ||
* [aos::crypto::CryptoProviderItf](../../common/crypto/crypto.hpp) - computes state file checksum; | ||
* [aos::crypto::CryptoProviderItf](../../common/crypto/itf/crypto.hpp) - computes state file checksum; |
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.
ditto
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.
done
} | ||
|
||
DecryptInfo CreateDecryptionInfo( | ||
cloudprotocol::DecryptInfo CreateDecryptionInfo( |
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.
cloudprotocol removed, should be rebased
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.
outdated file
src/core/common/crypto/crypto.md
Outdated
|
||
The crypto module implements a dual-backend architecture, providing two complete implementations: | ||
|
||
- **MbedTLS Implementation**: Lightweight, embedded-focused cryptographic library |
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.
Lightweight -> small letter
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.
done
src/core/common/crypto/crypto.md
Outdated
The crypto module implements a dual-backend architecture, providing two complete implementations: | ||
|
||
- **MbedTLS Implementation**: Lightweight, embedded-focused cryptographic library | ||
- **OpenSSL Implementation**: Full-featured, enterprise-grade cryptographic library |
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.
ditto
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.
done
|
||
## Interface Descriptions | ||
|
||
### UUIDItf |
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.
add empty line. Install md linter extension for vscode.
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.
done
### UUIDItf | ||
UUID generation interface for creating unique identifiers. | ||
|
||
**Methods:** |
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.
ditto
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.
done
f523031
to
e421564
Compare
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.
Reviewed-by: Oleksandr Grytsov <[email protected]>
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.
Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
VerifyOptions, Padding moved to crypto::x509 namespace Also removed redundant namespace qualifiers Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
Signed-off-by: Mykola Kobets <[email protected]> Reviewed-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]> Reviewed-by: Mykola Solianko <[email protected]>
e421564
to
7b8815c
Compare
|
No description provided.