fix mistakes
MODIFY
src/server/rest/v1/service/SettingService.ts
src/server/rest/v1/service/SettingService.ts
@@ -205,19 +205,17 @@ export default class SettingService {
// Update timestamp
setting.lastChangedBy = { 'id': req.user.id };
setting.lastChangedOn = new Date();
-
if (settingUpdate.identifier === TenantComponents.CRYPTO) {
if (Cypher.hash(settingUpdate.content.crypto.key) !== Cypher.hash(setting.content.crypto.key)) {
settingUpdate.content.crypto.migrationToBeDone = true;
}
settingUpdate.content.crypto.formerKey = setting.content.crypto.key;
}
-
// Update Setting
settingUpdate.id = await SettingStorage.saveSettings(req.user.tenantID, settingUpdate);
// Crypto Setting handling
if (settingUpdate.identifier === TenantComponents.CRYPTO) {
- if (settingUpdate.content.crypto.migrationToBeDone === true) {
+ if (settingUpdate.content.crypto.migrationToBeDone) {
await Cypher.handleCryptoSettingsChange(req.user.tenantID);
}
}

MODIFY
src/server/rest/v1/service/security/SettingSecurity.ts
src/server/rest/v1/service/security/SettingSecurity.ts
@@ -193,13 +193,13 @@ export default class SettingSecurity {
key: sanitize(request.content.crypto.key),
keyProperties: {
blockCypher: sanitize(request.content.crypto.keyProperties?.blockCypher),
- blockSize: sanitize(request.content.crypto.keyProperties?.blockSize),
+ blockSize: Utils.convertToInt(sanitize(request.content.crypto.keyProperties?.blockSize)),
operationMode: sanitize(request.content.crypto.keyProperties?.operationMode)
},
formerKey: sanitize(request.content.crypto.formerKey),
formerKeyProperties: {
blockCypher: sanitize(request.content.crypto.formerKeyProperties?.blockCypher),
- blockSize: sanitize(request.content.crypto.formerKeyProperties?.blockSize),
+ blockSize: Utils.convertToInt(sanitize(request.content.crypto.keyProperties?.blockSize)),
operationMode: sanitize(request.content.crypto.formerKeyProperties?.operationMode)
}
};

fix mistakes