Repository navigation
Add AES-256-GCM decryption to the crypto module - #71
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 106 |
| Duplication | 2 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
| const int32 AdditionalLimit = bAddGcm ? MaxAdditionalCryptors - 1 : MaxAdditionalCryptors; | ||
| if (AdditionalCount > AdditionalLimit) | ||
| { | ||
| UE_LOG(PubnubLog, Error, TEXT("InitCryptoModule accepts at most %d additional cryptors, including the AES-GCM decryptor."), MaxAdditionalCryptors); | ||
| return false; |
There was a problem hiding this comment.
🟠 High | Compatibility
Automatic GCM registration reduces the existing cryptor limit.
Existing calls with four nonempty AES/legacy fallbacks now return false because the automatic GCM cryptor reserves one of the four slots; a fresh module consequently cannot initialize a client. This limit change is undeclared under REVIEW.md’s Breaking changes rule. Preserve the previous capacity or declare the breaking change and migration requirement in the PR description.
| /** Keep in sync with VersionName in PubnubLibrary.uplugin. Used by dependent plugins (e.g. PubnubChat) for version checks. Two digits per component (max 99 each). */ | ||
| #define PUBNUB_LIBRARY_VERSION_MAJOR 3 | ||
| #define PUBNUB_LIBRARY_VERSION_MINOR 0 | ||
| #define PUBNUB_LIBRARY_VERSION_MINOR 1 |
There was a problem hiding this comment.
🔵 Minor | Release
Leave SDK release-version edits to the release pipeline.
This feature PR advances PUBNUB_LIBRARY_VERSION and .pubnub.yml to 3.1.0 while the plugin descriptor still advertises 3.0.0. REVIEW.md's Build and release integrity rule reserves these fields for release automation because the Chat SDK compile-depends on PUBNUB_LIBRARY_VERSION. Revert the SDK release-version edits and let the release pipeline update them together.
| * @return true when the module is ready. | ||
| */ | ||
| UFUNCTION(BlueprintCallable, Category = "PubNub|Crypto") | ||
| bool InitLegacyCryptoModule(const FString& CipherKey, bool bUseRandomIV = true); |
There was a problem hiding this comment.
🔵 Minor | Docs
Add consumer snippets for the new legacy and GCM APIs.
Sample_Crypto.cpp demonstrates InitAesCbcCryptoModule, but neither InitLegacyCryptoModule nor UPubnubGcmCryptor has a consumer sample. REVIEW.md's Samples rule requires snippets for new public API; add self-contained examples in the crypto sample for legacy module initialization and GCM decryption.
|
@pubnub-release-bot release as 3.1.0 |
| bool InitCryptoModule(const TScriptInterface<IPubnubCryptorInterface>& InDefaultCryptor, const TArray<TScriptInterface<IPubnubCryptorInterface>>& InAdditionalCryptors); | ||
|
|
||
| /** | ||
| * Prepares this module to encrypt with AES-256-CBC (identifier "ACRH"). |
There was a problem hiding this comment.
⚪ Nitpick | Docs
Document both new initializers as local operations.
REVIEW.md's Public comments rule requires public methods to identify local work with Local:. Add that execution contract to both InitAesCbcCryptoModule and InitLegacyCryptoModule so their editor tooltips make clear that initialization performs no network request.
|
🚀 Release successfully completed 🚀 |
feat(crypto): Decrypt AES-256-GCM messages
The crypto module now decrypts AES-256-GCM messages written with the same cipher key, including messages already in history. New messages are still encrypted with AES-CBC or the legacy cryptor.