Skip to content

Commit

Permalink
rever cryptors in config
Browse files Browse the repository at this point in the history
  • Loading branch information
mohitpubnub committed Sep 19, 2023
1 parent 3382595 commit da1cce6
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
5 changes: 0 additions & 5 deletions src/core/components/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,6 @@ export default class {

customDecrypt; // function used to decrypt old version messages

// registered cryptors for encryption and decryption of messages.
cryptors;

// File Upload

// How many times the publish-file should be retried before giving up
Expand Down Expand Up @@ -178,8 +175,6 @@ export default class {
this.customEncrypt = setup.customEncrypt;
this.customDecrypt = setup.customDecrypt;

this.cryptors = setup.cryptors || [];

this.fileUploadPublishRetryLimit = setup.fileUploadPublishRetryLimit ?? 5;
this.useRandomIVs = setup.useRandomIVs ?? true;

Expand Down
4 changes: 1 addition & 3 deletions src/core/components/subscription_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ export default class {
getFileUrl,
config,
crypto,
listenerManager,
cryptors,
listenerManager
}) {
this._listenerManager = listenerManager;
this._config = config;
Expand Down Expand Up @@ -730,7 +729,6 @@ export default class {

if (this._config.cipherKey) {
announce.message = this._crypto.decrypt(message.payload);
//TODO: select one of the cryptors and decrypt.
} else {
announce.message = message.payload;
}
Expand Down
3 changes: 0 additions & 3 deletions src/core/pubnub-common.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,6 @@ export default class {
const crypto = new Crypto({ config }); // LEGACY

const { cryptography } = setup;
const cryptors = [crypto, cryptography, ...config.cryptors];

networking.init(config);

Expand All @@ -298,7 +297,6 @@ export default class {
networking,
crypto,
cryptography,
cryptors,
tokenManager,
telemetryManager,
PubNubFile: setup.PubNubFile,
Expand Down Expand Up @@ -343,7 +341,6 @@ export default class {
config: modules.config,
listenerManager,
getFileUrl: (params) => getFileUrlFunction(modules, params),
cryptors: modules.cryptors,
});

this.subscribe = subscriptionManager.adaptSubscribeChange.bind(subscriptionManager);
Expand Down

0 comments on commit da1cce6

Please sign in to comment.