Skip to content

Conversation

mykola-kobets-epam
Copy link
Contributor

No description provided.

/**
* Random generator interface.
*/
class RandomItf {
Copy link
Member

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)

Copy link
Contributor Author

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

Copy link
Collaborator

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link

codecov bot commented Oct 7, 2025

Codecov Report

❌ Patch coverage is 94.07407% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.65%. Comparing base (b44aabc) to head (7b8815c).
⚠️ Report is 2 commits behind head on feature_unification.

Files with missing lines Patch % Lines
src/core/common/crypto/itf/privkey.hpp 92.85% 2 Missing ⚠️
src/core/common/crypto/itf/x509.hpp 33.33% 2 Missing ⚠️
src/core/common/crypto/cryptohelper.cpp 75.00% 1 Missing ⚠️
src/core/common/crypto/itf/rand.hpp 85.71% 1 Missing ⚠️
src/core/common/crypto/mbedtls/cryptoprovider.cpp 80.00% 1 Missing ⚠️
src/core/common/crypto/openssl/cryptoprovider.cpp 80.00% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@mlohvynenko mlohvynenko left a 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]>

@mykola-kobets-epam mykola-kobets-epam force-pushed the crypto-refactoring branch 4 times, most recently from 4523069 to 7e2cc45 Compare October 9, 2025 10:50
@al1img
Copy link
Collaborator

al1img commented Oct 10, 2025

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

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?

Copy link
Contributor Author

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

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.

@mykola-kobets-epam mykola-kobets-epam force-pushed the crypto-refactoring branch 2 times, most recently from d07756d to f523031 Compare October 11, 2025 22:33
/***
* UUID generator interface.
*/
class UUIDItf {
Copy link
Collaborator

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

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

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

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

outdated file


The crypto module implements a dual-backend architecture, providing two complete implementations:

- **MbedTLS Implementation**: Lightweight, embedded-focused cryptographic library
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lightweight -> small letter

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


## Interface Descriptions

### UUIDItf
Copy link
Collaborator

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.

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Collaborator

@al1img al1img left a 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]>

Copy link

@MykolaSuperman MykolaSuperman left a 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]>
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
1 Security Hotspot
56.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants