Skip to content

Cipher Tool Throws an Error when there are configurations under the [secrets] section #4561

@Neethamadhu-Madurasinghe

Description

Description

Looks like the cipher tool included in the APIM 4.5.36 has a small bug. This bug causes the cipher tool to throw errors when running password encryption command.

sh ciphertool.sh --Dconfigure --Dpassword=abc

Error

Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.isEmpty()" because "str" is null
      at java.base/java.lang.String.concat(String.java:2771)
      at org.wso2.ciphertool.CipherTool.updateDeploymentConfigurationWithEncryptedKeys(CipherTool.java:452)
      at org.wso2.ciphertool.CipherTool.main(CipherTool.java:92)

We analyzed the issue and found that this occurs only when there is a configuration section below the [secrets] in the deployment.toml file.

[secrets]
admin_password  = "[admin]"
ks_password = "[wso2carbon]"

[something]
xyz = "abc"

Steps to Reproduce

Deploy an APIM 4.5.36 pack.
Use secret encryption [1]
Edit the deployment.toml file and add a new configuration below [secrets] section
Run sh ciphertool.sh --Dconfigure --Dpassword=abc

[1] https://apim.docs.wso2.com/en/4.5.0/install-and-setup/setup/security/logins-and-passwords/working-with-encrypted-passwords/

Version

4.5.0.36

Environment Details (with versions)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions