bbende commented on a change in pull request #4427:
URL: https://github.com/apache/nifi/pull/4427#discussion_r460291793
##########
File path:
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/encrypt/StringEncryptor.java
##########
@@ -267,6 +296,16 @@ private boolean paramsAreValid() {
return algorithmAndProviderValid && secretIsValid;
}
+ private boolean customSecretIsValid(PBEKeySpec password, SecretKeySpec
key, String algorithm) {
+ // Currently, the only custom algorithms use AES-G/CM with a password
via Argon2
+ String rawPassword = new String(password.getPassword());
+ final boolean secretIsValid = StringUtils.isNotBlank(rawPassword) &&
rawPassword.trim().length() >= 12;
+ if (!secretIsValid) {
+ logger.error("The nifi.sensitive.props.key password provided is
invalid for algorithm {}; must be >= 12 characters", algorithm);
Review comment:
Just to clarify, we do print this first....
```
2020-07-24 17:12:31,384 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
********************************************************************************
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* A blank sensitive properties key was provided *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* Specify a unique key in nifi.properties *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* for nifi.sensitive.props.key *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* The Encrypt Config Tool in NiFi Toolkit can be used to *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
* migrate the flow to the new key *
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
********************************************************************************
2020-07-24 17:12:31,385 ERROR [main] org.apache.nifi.encrypt.StringEncryptor
The nifi.sensitive.props.key password provided is invalid for algorithm
NIFI_ARGON2_AES_GCM_256; must be >= 12 characters
```
but then after there are two stacktraces that I think overshadow this and
don't have any specifics.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]