adamdebreceni commented on a change in pull request #937:
URL: https://github.com/apache/nifi-minifi-cpp/pull/937#discussion_r526003991



##########
File path: encrypt-config/EncryptConfig.cpp
##########
@@ -90,33 +122,44 @@ std::string EncryptConfig::propertiesFilePath() const {
       MINIFI_PROPERTIES_FILE_NAME);
 }
 
-utils::crypto::Bytes EncryptConfig::getEncryptionKey() const {
+utils::crypto::EncryptionKeys EncryptConfig::getEncryptionKeys() const {
   encrypt_config::ConfigFile 
bootstrap_file{std::ifstream{bootstrapFilePath()}};
-  utils::optional<std::string> key_from_bootstrap_file = 
bootstrap_file.getValue(ENCRYPTION_KEY_PROPERTY_NAME);
+  utils::optional<std::string> decryption_key_hex = 
bootstrap_file.getValue(DECRYPTION_KEY_PROPERTY_NAME);
+  utils::optional<std::string> encryption_key_hex = 
bootstrap_file.getValue(ENCRYPTION_KEY_PROPERTY_NAME);
+
+  utils::crypto::EncryptionKeys keys;
+  if (!decryption_key_hex || decryption_key_hex->empty()) {
+    std::cout << "No decryption key was provided\n";

Review comment:
       removed log, hopefully replaced all references to a "deprecated 
key"/"decryption key" with "old key" or "old encryption key"

##########
File path: encrypt-config/EncryptConfig.cpp
##########
@@ -42,40 +42,72 @@ namespace nifi {
 namespace minifi {
 namespace encrypt_config {
 
-EncryptConfig::EncryptConfig(int argc, char* argv[]) : 
minifi_home_(parseMinifiHomeFromTheOptions(argc, argv)) {
+EncryptConfig::EncryptConfig(const std::string& minifi_home) : 
minifi_home_(minifi_home) {
   if (sodium_init() < 0) {
     throw std::runtime_error{"Could not initialize the libsodium library!"};
   }
+  keys_ = getEncryptionKeys();

Review comment:
       added comment




----------------------------------------------------------------
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]


Reply via email to