[nifi] branch support/nifi-1.x updated: NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch support/nifi-1.x in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/support/nifi-1.x by this push: new 71baa2c4ce NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99 71baa2c4ce is described below commit 71baa2c4ce115a9df2788a6be98ac9d770905225 Author: exceptionfactory AuthorDate: Mon Oct 2 16:52:22 2023 -0500 NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99 Signed-off-by: Joseph Witt --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7c5507c4ab..fb5cdb1dfc 100644 --- a/pom.xml +++ b/pom.xml @@ -143,7 +143,7 @@ 1.3.11 3.10.6.Final 2.2 -4.1.98.Final +4.1.99.Final 5.3.30 5.8.7 1.6.11
[nifi] branch main updated: NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/main by this push: new 2c79b5f8e2 NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99 2c79b5f8e2 is described below commit 2c79b5f8e2bbbfadb5defc623b6c95bc1a26343e Author: exceptionfactory AuthorDate: Mon Oct 2 16:52:22 2023 -0500 NIFI-12162 This closes #7831. Upgraded Netty from 4.1.98 to 4.1.99 Signed-off-by: Joseph Witt --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3cce6d87fb..30fb7f391e 100644 --- a/pom.xml +++ b/pom.xml @@ -142,7 +142,7 @@ 5.5.0 3.10.6.Final 2.2 -4.1.98.Final +4.1.99.Final 5.3.30 5.8.7 1.6.11
[nifi] branch main updated: NIFI-12131 Fixed potential NPE related to FlowAnalyzer
This is an automated email from the ASF dual-hosted git repository. exceptionfactory pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/main by this push: new 9c425d273c NIFI-12131 Fixed potential NPE related to FlowAnalyzer 9c425d273c is described below commit 9c425d273c8b11d9a3ba74bdabe620cff2617b42 Author: Tamas Palfy AuthorDate: Thu Sep 28 16:09:34 2023 +0200 NIFI-12131 Fixed potential NPE related to FlowAnalyzer Revamped RuleViolationsManager and FlowAnalyzer handling to make sure no issue occurs when these are not set. Fix ResourceNotFoundException: When determining the subject permissions for a rule violation the type of the subject is now known, so we try to lookup all possible types. Non-matching tpyes throw a ResourceNotFoundException exception though. Going to ignore those. This closes #7809 Signed-off-by: David Handermann --- .../nifi/controller/flow/AbstractFlowManager.java | 27 +-- .../service/StandardControllerServiceNode.java | 3 +- .../service/StandardControllerServiceProvider.java | 4 ++- .../StandardValidationContextFactory.java | 9 ++--- .../nifi/controller/AbstractComponentNode.java | 6 ++-- .../org/apache/nifi/controller/ProcessorNode.java | 4 +-- .../nifi/controller/ValidationContextFactory.java | 5 +-- .../apache/nifi/controller/flow/FlowManager.java | 4 +-- .../org/apache/nifi/controller/FlowController.java | 38 ++ .../nifi/controller/flow/StandardFlowManager.java | 18 ++ .../apache/nifi/web/StandardNiFiServiceFacade.java | 14 +--- 11 files changed, 79 insertions(+), 53 deletions(-) diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/flow/AbstractFlowManager.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/flow/AbstractFlowManager.java index 38dde287a9..4a8a714398 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/flow/AbstractFlowManager.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/flow/AbstractFlowManager.java @@ -59,6 +59,7 @@ import java.util.HashSet; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.UUID; import java.util.concurrent.ConcurrentHashMap; @@ -124,7 +125,7 @@ public abstract class AbstractFlowManager implements FlowManager { String identifier = group.getIdentifier(); allProcessGroups.remove(identifier); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +removeRuleViolationsForSubject(identifier); } public void onProcessorAdded(final ProcessorNode procNode) { @@ -137,7 +138,7 @@ public abstract class AbstractFlowManager implements FlowManager { allProcessors.remove(identifier); pythonBridge.onProcessorRemoved(identifier, procNode.getComponentType(), procNode.getBundleCoordinate().getVersion()); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +removeRuleViolationsForSubject(identifier); } public Set findAllProcessors(final Predicate filter) { @@ -197,7 +198,7 @@ public abstract class AbstractFlowManager implements FlowManager { flowFileEventRepository.purgeTransferEvents(identifier); allConnections.remove(identifier); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +removeRuleViolationsForSubject(identifier); } public Connection getConnection(final String id) { @@ -353,7 +354,7 @@ public abstract class AbstractFlowManager implements FlowManager { flowFileEventRepository.purgeTransferEvents(identifier); allInputPorts.remove(identifier); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +removeRuleViolationsForSubject(identifier); } public Port getInputPort(final String id) { @@ -369,7 +370,7 @@ public abstract class AbstractFlowManager implements FlowManager { flowFileEventRepository.purgeTransferEvents(identifier); allOutputPorts.remove(identifier); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +removeRuleViolationsForSubject(identifier); } public Port getOutputPort(final String id) { @@ -385,7 +386,7 @@ public abstract class AbstractFlowManager implements FlowManager { flowFileEventRepository.purgeTransferEvents(identifier); allFunnels.remove(identifier); -ruleViolationsManager.removeRuleViolationsForSubject(identifier); +
[nifi-minifi-cpp] 02/02: MINIFICPP-2233 Update bustache to fix gcc13 compatibility
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit a38b5a2ebc25ecc9517225b2fd6502c78b908b79 Author: Martin Zink AuthorDate: Mon Oct 2 20:22:22 2023 +0200 MINIFICPP-2233 Update bustache to fix gcc13 compatibility Closes #1672 Signed-off-by: Marton Szasz --- cmake/Bustache.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/Bustache.cmake b/cmake/Bustache.cmake index a2e8d84dd..116028775 100644 --- a/cmake/Bustache.cmake +++ b/cmake/Bustache.cmake @@ -21,6 +21,6 @@ include(fmt) set(BUSTACHE_USE_FMT ON CACHE STRING "" FORCE) FetchContent_Declare(Bustache GIT_REPOSITORY https://github.com/jamboree/bustache.git -GIT_TAG ee39a375d49677af9728722bfabf63eaed3c82fd +GIT_TAG 47096caa8e1f9f7ebe34e3a022dbb822c174011d ) FetchContent_MakeAvailable(Bustache)
[nifi-minifi-cpp] 01/02: MINIFICPP-2212 use administrative yield duration instead of onschedule retry interval
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit 4624d302ac3522c948fe87bbd96a7a6f6c8de901 Author: Martin Zink AuthorDate: Mon Oct 2 19:31:09 2023 +0200 MINIFICPP-2212 use administrative yield duration instead of onschedule retry interval Closes #1664 Signed-off-by: Marton Szasz --- CONFIGURE.md| 1 - libminifi/include/SchedulingAgent.h | 2 ++ libminifi/include/core/ProcessGroup.h | 9 - libminifi/include/core/flow/FlowSchema.h| 1 - libminifi/src/agent/JsonSchema.cpp | 4 +--- libminifi/src/core/ProcessGroup.cpp | 17 + libminifi/src/core/flow/FlowSchema.cpp | 2 -- libminifi/src/core/flow/StructuredConfiguration.cpp | 11 --- .../test/integration/OnScheduleErrorHandlingTests.cpp | 2 ++ libminifi/test/resources/TestKafkaOnSchedule.yml| 1 - libminifi/test/resources/TestOnScheduleRetry.yml| 1 - libminifi/test/resources/TestStateTransactionality.yml | 1 - 12 files changed, 10 insertions(+), 42 deletions(-) diff --git a/CONFIGURE.md b/CONFIGURE.md index 178821994..f23b389a9 100644 --- a/CONFIGURE.md +++ b/CONFIGURE.md @@ -29,7 +29,6 @@ It's recommended to create your configuration in YAML format or configure the ag Flow Controller: id: 471deef6-2a6e-4a7d-912a-81cc17e3a205 name: MiNiFi Flow -onschedule retry interval: 3 ms Processors: - name: GetFile diff --git a/libminifi/include/SchedulingAgent.h b/libminifi/include/SchedulingAgent.h index b24b74d97..398cd52d2 100644 --- a/libminifi/include/SchedulingAgent.h +++ b/libminifi/include/SchedulingAgent.h @@ -109,6 +109,8 @@ class SchedulingAgent { SchedulingAgent(const SchedulingAgent ) = delete; SchedulingAgent =(const SchedulingAgent ) = delete; + std::chrono::milliseconds getAdminYieldDuration() const { return admin_yield_duration_; } + protected: std::mutex mutex_; std::atomic running_; diff --git a/libminifi/include/core/ProcessGroup.h b/libminifi/include/core/ProcessGroup.h index ce507cb9a..d149dad69 100644 --- a/libminifi/include/core/ProcessGroup.h +++ b/libminifi/include/core/ProcessGroup.h @@ -132,14 +132,6 @@ class ProcessGroup : public CoreComponent { return (yield_period_msec_); } - void setOnScheduleRetryPeriod(int64_t period) { -onschedule_retry_msec_ = period; - } - - int64_t getOnScheduleRetryPeriod() { -return onschedule_retry_msec_; - } - int getVersion() const { return config_version_; } @@ -247,7 +239,6 @@ class ProcessGroup : public CoreComponent { // Yield Period in Milliseconds std::atomic yield_period_msec_; std::atomic timeout_; - std::atomic onschedule_retry_msec_; // URL std::string url_; diff --git a/libminifi/include/core/flow/FlowSchema.h b/libminifi/include/core/flow/FlowSchema.h index 0badac303..773550ddc 100644 --- a/libminifi/include/core/flow/FlowSchema.h +++ b/libminifi/include/core/flow/FlowSchema.h @@ -36,7 +36,6 @@ struct FlowSchema { Keys penalization_period; Keys proc_yield_period; Keys runduration_nanos; - Keys onschedule_retry_interval; Keys connections; Keys max_queue_size; diff --git a/libminifi/src/agent/JsonSchema.cpp b/libminifi/src/agent/JsonSchema.cpp index f9bfa3895..90a1df510 100644 --- a/libminifi/src/agent/JsonSchema.cpp +++ b/libminifi/src/agent/JsonSchema.cpp @@ -353,7 +353,6 @@ static std::string buildSchema(const std::unordered_map ProcessGroup::id_generator_ = utils::IdGenerator::getIdGenerator(); ProcessGroup::ProcessGroup(ProcessGroupType type, std::string_view name, const utils::Identifier& uuid) @@ -54,12 +52,6 @@ ProcessGroup::ProcessGroup(ProcessGroupType type, std::string_view name, const u transmitting_(false), transport_protocol_("RAW"), logger_(logging::LoggerFactory::getLogger()) { - if (parent_process_group_ != nullptr) { -onschedule_retry_msec_ = parent_process_group_->getOnScheduleRetryPeriod(); - } else { -onschedule_retry_msec_ = DEFAULT_ONSCHEDULE_RETRY_INTERVAL_MS; - } - logger_->log_debug("ProcessGroup %s created", name_); } @@ -69,7 +61,6 @@ ProcessGroup::ProcessGroup(ProcessGroupType type, std::string_view name) type_(type), parent_process_group_(nullptr), yield_period_msec_(0ms), - onschedule_retry_msec_(DEFAULT_ONSCHEDULE_RETRY_INTERVAL_MS), transmitting_(false), transport_protocol_("RAW"), logger_(logging::LoggerFactory::getLogger()) { @@ -167,12 +158,14 @@ void ProcessGroup::startProcessingProcessors(TimerDrivenSchedulingAgent& timeSch } } - if (!onScheduleTimer_ && !failed_processors_.empty() && onschedule_retry_msec_ > 0) { -
[nifi-minifi-cpp] branch main updated (61f7982b9 -> a38b5a2eb)
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git from 61f7982b9 MINIFICPP-2227 Upgrade docker base image to alpine:3.18 new 4624d302a MINIFICPP-2212 use administrative yield duration instead of onschedule retry interval new a38b5a2eb MINIFICPP-2233 Update bustache to fix gcc13 compatibility The 2 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: CONFIGURE.md| 1 - cmake/Bustache.cmake| 2 +- libminifi/include/SchedulingAgent.h | 2 ++ libminifi/include/core/ProcessGroup.h | 9 - libminifi/include/core/flow/FlowSchema.h| 1 - libminifi/src/agent/JsonSchema.cpp | 4 +--- libminifi/src/core/ProcessGroup.cpp | 17 + libminifi/src/core/flow/FlowSchema.cpp | 2 -- libminifi/src/core/flow/StructuredConfiguration.cpp | 11 --- .../test/integration/OnScheduleErrorHandlingTests.cpp | 2 ++ libminifi/test/resources/TestKafkaOnSchedule.yml| 1 - libminifi/test/resources/TestOnScheduleRetry.yml| 1 - libminifi/test/resources/TestStateTransactionality.yml | 1 - 13 files changed, 11 insertions(+), 43 deletions(-)
[nifi] branch main updated: NIFI-12157 This closes #7826. Removed nifi-logging-utils and NiFiLog - Replaced NiFiLog references with direct references to SLF4J LoggerFactory
This is an automated email from the ASF dual-hosted git repository. joewitt pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/main by this push: new 19b4be40aa NIFI-12157 This closes #7826. Removed nifi-logging-utils and NiFiLog - Replaced NiFiLog references with direct references to SLF4J LoggerFactory 19b4be40aa is described below commit 19b4be40aa84b01eed4437658ccfab6b4d32ce51 Author: exceptionfactory AuthorDate: Sat Sep 30 20:26:40 2023 -0500 NIFI-12157 This closes #7826. Removed nifi-logging-utils and NiFiLog - Replaced NiFiLog references with direct references to SLF4J LoggerFactory Signed-off-by: Joseph Witt --- minifi/pom.xml | 5 - nifi-commons/nifi-logging-utils/pom.xml| 31 -- .../main/java/org/apache/nifi/logging/NiFiLog.java | 366 - nifi-commons/nifi-socket-utils/pom.xml | 5 - .../org/apache/nifi/io/socket/SocketUtils.java | 7 +- nifi-commons/pom.xml | 1 - .../nifi-framework-cluster-protocol/pom.xml| 5 - .../nifi-framework/nifi-framework-cluster/pom.xml | 4 - .../impl/FileBasedClusterNodeFirewall.java | 6 +- .../nifi-framework/nifi-framework-core/pom.xml | 5 - .../apache/nifi/web/util/ClientResponseUtils.java | 5 +- .../web/security/requests/ContentLengthFilter.java | 3 +- nifi-nar-bundles/nifi-framework-bundle/pom.xml | 5 - 13 files changed, 8 insertions(+), 440 deletions(-) diff --git a/minifi/pom.xml b/minifi/pom.xml index 6c3a464aca..8121282e03 100644 --- a/minifi/pom.xml +++ b/minifi/pom.xml @@ -365,11 +365,6 @@ limitations under the License. nifi-xml-processing 2.0.0-SNAPSHOT - -org.apache.nifi -nifi-logging-utils -2.0.0-SNAPSHOT - org.apache.nifi nifi-nar-utils diff --git a/nifi-commons/nifi-logging-utils/pom.xml b/nifi-commons/nifi-logging-utils/pom.xml deleted file mode 100644 index 62b9276879..00 --- a/nifi-commons/nifi-logging-utils/pom.xml +++ /dev/null @@ -1,31 +0,0 @@ - - -http://maven.apache.org/POM/4.0.0; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd;> -4.0.0 - -org.apache.nifi -nifi-commons -2.0.0-SNAPSHOT - -nifi-logging-utils -Utilities for logging - - -org.slf4j -slf4j-api - - - diff --git a/nifi-commons/nifi-logging-utils/src/main/java/org/apache/nifi/logging/NiFiLog.java b/nifi-commons/nifi-logging-utils/src/main/java/org/apache/nifi/logging/NiFiLog.java deleted file mode 100644 index 8f6f1d954f..00 --- a/nifi-commons/nifi-logging-utils/src/main/java/org/apache/nifi/logging/NiFiLog.java +++ /dev/null @@ -1,366 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.apache.nifi.logging; - -import org.slf4j.Logger; -import org.slf4j.Marker; - -/** - * - */ -public class NiFiLog implements Logger { - -private final Logger logger; - -public NiFiLog(final Logger logger) { -this.logger = logger; -} - -public Logger getWrappedLog() { -return logger; -} - -@Override -public void warn(Marker marker, String string, Throwable thrwbl) { -if (logger.isDebugEnabled()) { -logger.warn(marker, string, thrwbl); -} else { -logger.warn(marker, string); -} -} - -@Override -public void warn(Marker marker, String string, Object... os) { -logger.warn(marker, string, os); -} - -@Override -public void warn(Marker marker, String string, Object o, Object o1) { -logger.warn(marker, string, o, o1); -} - -@Override -public void warn(Marker marker, String string, Object o) { -logger.warn(marker, string, o); -} - -@Override -public void warn(Marker marker, String string) { -logger.warn(marker,
[nifi] branch support/nifi-1.x updated: NIFI-12038 This closes #7760. introduce PackageFlowFile processor
This is an automated email from the ASF dual-hosted git repository. mosermw pushed a commit to branch support/nifi-1.x in repository https://gitbox.apache.org/repos/asf/nifi.git The following commit(s) were added to refs/heads/support/nifi-1.x by this push: new 4c5ea5f4da NIFI-12038 This closes #7760. introduce PackageFlowFile processor 4c5ea5f4da is described below commit 4c5ea5f4da58ac26ad7d450c194834db72a8ae1d Author: Mike Moser AuthorDate: Thu Sep 14 19:48:09 2023 + NIFI-12038 This closes #7760. introduce PackageFlowFile processor Signed-off-by: Joseph Witt --- .../org/apache/nifi/util/FlowFilePackagerV3.java | 2 +- .../apache/nifi/util/TestPackageUnpackageV3.java | 2 + .../nifi/processors/standard/PackageFlowFile.java | 134 .../services/org.apache.nifi.processor.Processor | 1 + .../processors/standard/TestPackageFlowFile.java | 139 + 5 files changed, 277 insertions(+), 1 deletion(-) diff --git a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFilePackagerV3.java b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFilePackagerV3.java index 181f3e3079..4487ed69fb 100644 --- a/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFilePackagerV3.java +++ b/nifi-commons/nifi-flowfile-packager/src/main/java/org/apache/nifi/util/FlowFilePackagerV3.java @@ -37,7 +37,7 @@ public class FlowFilePackagerV3 implements FlowFilePackager { writeFieldLength(out, attributes.size()); //write out the number of attributes for (final Map.Entry entry : attributes.entrySet()) { //write out each attribute key/value pair writeString(entry.getKey(), out); -writeString(entry.getValue(), out); +writeString(entry.getValue() == null ? "" : entry.getValue(), out); } } diff --git a/nifi-commons/nifi-flowfile-packager/src/test/java/org/apache/nifi/util/TestPackageUnpackageV3.java b/nifi-commons/nifi-flowfile-packager/src/test/java/org/apache/nifi/util/TestPackageUnpackageV3.java index 1bd8f09821..cd6a1a523d 100644 --- a/nifi-commons/nifi-flowfile-packager/src/test/java/org/apache/nifi/util/TestPackageUnpackageV3.java +++ b/nifi-commons/nifi-flowfile-packager/src/test/java/org/apache/nifi/util/TestPackageUnpackageV3.java @@ -38,6 +38,7 @@ public class TestPackageUnpackageV3 { final byte[] data = "Hello, World!".getBytes(StandardCharsets.UTF_8); final Map map = new HashMap<>(); map.put("abc", "cba"); +map.put("123", null); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); final ByteArrayInputStream in = new ByteArrayInputStream(data); @@ -49,6 +50,7 @@ public class TestPackageUnpackageV3 { final Map unpackagedAttributes = unpackager.unpackageFlowFile(encodedIn, decodedOut); final byte[] decoded = decodedOut.toByteArray(); +map.put("123", ""); // replace null attribute for verification, because it is packaged as empty string assertEquals(map, unpackagedAttributes); assertArrayEquals(data, decoded); } diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PackageFlowFile.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PackageFlowFile.java new file mode 100644 index 00..3e589a7104 --- /dev/null +++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PackageFlowFile.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.nifi.processors.standard; + +import org.apache.nifi.annotation.behavior.InputRequirement; +import org.apache.nifi.annotation.behavior.SideEffectFree; +import org.apache.nifi.annotation.behavior.SupportsBatching; +import org.apache.nifi.annotation.behavior.WritesAttribute; +import org.apache.nifi.annotation.behavior.WritesAttributes; +import org.apache.nifi.annotation.documentation.CapabilityDescription; +import
[nifi-minifi-cpp] 02/06: MINIFICPP-2207 HttpRequestMethod should be an enum
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit 67b63be7263955d0a3850b56fee970282fec6e24 Author: Ferenc Gerlits AuthorDate: Mon Oct 2 13:55:29 2023 +0200 MINIFICPP-2207 HttpRequestMethod should be an enum There is a well-defined list of possible HTTP request methods; we should not accept arbitrary strings. Closes #1657 Signed-off-by: Marton Szasz --- .clang-tidy| 1 - extensions/civetweb/tests/ListenHTTPTests.cpp | 125 +++-- extensions/elasticsearch/PostElasticsearch.cpp | 2 +- extensions/http-curl/client/HTTPClient.cpp | 62 +- extensions/http-curl/client/HTTPClient.h | 7 +- extensions/http-curl/processors/InvokeHTTP.cpp | 10 +- extensions/http-curl/processors/InvokeHTTP.h | 10 +- extensions/http-curl/protocols/RESTSender.cpp | 8 +- extensions/http-curl/protocols/RESTSender.h| 2 +- extensions/http-curl/sitetosite/HTTPProtocol.cpp | 11 +- extensions/http-curl/sitetosite/HTTPProtocol.h | 2 +- .../http-curl/tests/unit/HTTPClientTests.cpp | 17 +-- extensions/splunk/SplunkHECProcessor.cpp | 2 +- libminifi/include/utils/BaseHTTPClient.h | 10 +- libminifi/src/RemoteProcessorGroupPort.cpp | 11 +- libminifi/src/core/logging/alert/AlertSink.cpp | 2 +- libminifi/src/utils/BaseHTTPClient.cpp | 2 +- 17 files changed, 148 insertions(+), 136 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 2345a2425..ac7598997 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -55,7 +55,6 @@ Checks: > bugprone-terminating-continue, bugprone-throw-keyword-missing, bugprone-too-small-loop-variable, - bugprone-unchecked-optional-access, bugprone-undefined-memory-manipulation, bugprone-undelegated-constructor, bugprone-unhandled-exception-at-new, diff --git a/extensions/civetweb/tests/ListenHTTPTests.cpp b/extensions/civetweb/tests/ListenHTTPTests.cpp index f8a51abe9..d64e2bbd5 100644 --- a/extensions/civetweb/tests/ListenHTTPTests.cpp +++ b/extensions/civetweb/tests/ListenHTTPTests.cpp @@ -41,6 +41,7 @@ namespace org::apache::nifi::minifi::test { using namespace std::literals::chrono_literals; +using HttpRequestMethod = org::apache::nifi::minifi::utils::HttpRequestMethod; class ListenHTTPTestsFixture { public: @@ -154,7 +155,7 @@ class ListenHTTPTestsFixture { for (const auto : headers) { client->setRequestHeader(header.first, header.second); } -if (method == "POST") { +if (method == HttpRequestMethod::POST) { client->setPostFields(payload); } } @@ -173,7 +174,7 @@ class ListenHTTPTestsFixture { } void check_response_body() { -if (method != "GET" && method != "POST") { +if (method != HttpRequestMethod::GET && method != HttpRequestMethod::POST) { return; } @@ -212,7 +213,7 @@ class ListenHTTPTestsFixture { plan->runCurrentProcessor(); // ListenHTTP plan->runNextProcessor(); // LogAttribute -if (expected_commited_requests > 0 && (method == "GET" || method == "POST")) { +if (expected_commited_requests > 0 && (method == HttpRequestMethod::GET || method == HttpRequestMethod::POST)) { REQUIRE(LogTestController::getInstance().contains("Size:" + std::to_string(payload.size()) + " Offset:0")); } REQUIRE(LogTestController::getInstance().contains("Logged " + std::to_string(expected_commited_requests) + " flow files")); @@ -228,7 +229,7 @@ class ListenHTTPTestsFixture { std::shared_ptr log_attribute; std::shared_ptr ssl_context_service; - std::string method = "GET"; + HttpRequestMethod method = HttpRequestMethod::GET; std::map headers; std::string payload; std::string endpoint = "test"; @@ -253,7 +254,7 @@ TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP GET", "[basic]") { TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP POST", "[basic]") { run_server(); - method = "POST"; + method = HttpRequestMethod::POST; payload = "Test payload"; test_connect(); @@ -262,7 +263,7 @@ TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP POST", "[basic]") { TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP PUT", "[basic]") { run_server(); - method = "PUT"; + method = HttpRequestMethod::PUT; test_connect({HttpResponseExpectations{true, 405}}, 0); } @@ -270,7 +271,7 @@ TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP PUT", "[basic]") { TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP DELETE", "[basic]") { run_server(); - method = "DELETE"; + method = HttpRequestMethod::DELETE; test_connect({HttpResponseExpectations{true, 405}}, 0); } @@ -278,7 +279,7 @@ TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP DELETE", "[basic]") { TEST_CASE_METHOD(ListenHTTPTestsFixture, "HTTP HEAD", "[basic]") {
[nifi-minifi-cpp] 06/06: MINIFICPP-2227 Upgrade docker base image to alpine:3.18
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit 61f7982b9b05bdc9f6f518126873d1d84268d6c9 Author: Gabor Gyimesi AuthorDate: Mon Oct 2 13:57:55 2023 +0200 MINIFICPP-2227 Upgrade docker base image to alpine:3.18 Closes #1667 Signed-off-by: Marton Szasz --- cmake/BundledLibcURL.cmake | 2 ++ docker/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/BundledLibcURL.cmake b/cmake/BundledLibcURL.cmake index 775a2d7e6..095c2d58d 100644 --- a/cmake/BundledLibcURL.cmake +++ b/cmake/BundledLibcURL.cmake @@ -42,6 +42,8 @@ function(use_bundled_curl SOURCE_DIR BINARY_DIR) -DCURL_DISABLE_CRYPTO_AUTH=ON -DCURL_CA_PATH=none -DCURL_USE_LIBSSH2=OFF +-DUSE_LIBIDN2=OFF +-DCURL_USE_LIBPSL=OFF -DCMAKE_DEBUG_POSTFIX= -DHAVE_GLIBC_STRERROR_R=1 -DHAVE_GLIBC_STRERROR_R__TRYRUN_OUTPUT="" diff --git a/docker/Dockerfile b/docker/Dockerfile index 934f0a3f1..d4092357f 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -16,7 +16,7 @@ # under the License. # -ARG BASE_IMAGE="alpine:3.17" +ARG BASE_IMAGE="alpine:3.18" # Build image FROM ${BASE_IMAGE} AS build
[nifi-minifi-cpp] 04/06: MINIFICPP-2221 Auto-generate CONTROLLERS.md
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit 7e7984b94ab61526b8b41e400744311f46a3ad63 Author: Ferenc Gerlits AuthorDate: Mon Oct 2 13:57:13 2023 +0200 MINIFICPP-2221 Auto-generate CONTROLLERS.md Also: * simplify the auto-generation of PROCESSORS.md: don't create individual files for each processor * add missing controller services to CONTROLLERS.md * move some descriptions from CONTROLLERS.md to the Description of the controller services * fix some Visual Studio warnings and a bug in formatAllowedValues(). Closes #1665 Signed-off-by: Marton Szasz --- CONTROLLERS.md | 297 + PROCESSORS.md | 244 - .../aws/controllerservices/AWSCredentialsService.h | 4 +- .../AzureStorageCredentialsService.h | 3 +- .../GCPCredentialsControllerService.h | 3 +- libminifi/include/controllers/SSLContextService.h | 10 +- libminifi/include/core/PropertyDefinition.h| 4 +- libminifi/include/core/PropertyType.h | 16 +- minifi_main/AgentDocs.cpp | 234 minifi_main/AgentDocs.h| 9 +- minifi_main/MiNiFiMain.cpp | 28 +- 11 files changed, 525 insertions(+), 327 deletions(-) diff --git a/CONTROLLERS.md b/CONTROLLERS.md index 0939a8846..3468929de 100644 --- a/CONTROLLERS.md +++ b/CONTROLLERS.md @@ -1,46 +1,53 @@ -# Controller Services - ## Table of Contents - [AWSCredentialsService](#AWSCredentialsService) - [AzureStorageCredentialsService](#AzureStorageCredentialsService) -- [GCPCredentialsControllerService](#GCPCredentialsControllerService) - [ElasticsearchCredentialsControllerService](#ElasticsearchCredentialsControllerService) -- [KubernetesControllerService](#kubernetesControllerService) +- [ExecuteJavaControllerService](#ExecuteJavaControllerService) +- [GCPCredentialsControllerService](#GCPCredentialsControllerService) +- [JavaControllerService](#JavaControllerService) +- [KubernetesControllerService](#KubernetesControllerService) +- [LinuxPowerManagerService](#LinuxPowerManagerService) +- [NetworkPrioritizerService](#NetworkPrioritizerService) +- [ODBCService](#ODBCService) +- [PersistentMapStateStorage](#PersistentMapStateStorage) +- [RocksDbStateStorage](#RocksDbStateStorage) +- [SmbConnectionControllerService](#SmbConnectionControllerService) +- [SSLContextService](#SSLContextService) +- [UpdatePolicyControllerService](#UpdatePolicyControllerService) +- [VolatileMapStateStorage](#VolatileMapStateStorage) + ## AWSCredentialsService ### Description -Manages the Amazon Web Services (AWS) credentials for an AWS account. This allows for multiple -AWS credential services to be defined. This also allows for multiple AWS related processors to reference this single -controller service so that AWS credentials can be managed and controlled in a central location. +Manages the Amazon Web Services (AWS) credentials for an AWS account. This allows for multiple AWS credential services to be defined. This also allows for multiple AWS related processors to reference this single controller service so that AWS credentials can be managed and controlled in a central location. ### Properties -In the list below, the names of required properties appear in bold. Any other -properties (not in bold) are considered optional. +In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language. | Name| Default Value | Allowable Values | Description | |-|---|--|-| -| **Use Default Credentials** | false | | If true, uses the Default Credential chain, including EC2 instance profiles or roles, environment variables, default user credentials, etc. | -| Access Key | | | Specifies the AWS Access Key | -| Secret Key | | | Specifies the AWS Secret Key | +| **Use Default Credentials** | false | truefalse | If true,
[nifi-minifi-cpp] branch main updated (fe7abb230 -> 61f7982b9)
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a change to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git from fe7abb230 MINIFICPP-2204 Fix build with clang16 and upgrade in CI new a77c85727 MINIFICPP-2191 Replace deprecated OpenSSL API calls new 67b63be72 MINIFICPP-2207 HttpRequestMethod should be an enum new e8b95c74a MINIFICPP-2196 Integrate cppcoreguideline clang-tidy checks in CI new 7e7984b94 MINIFICPP-2221 Auto-generate CONTROLLERS.md new 393716b59 MINIFICPP-2228 Fix clang job cache key name in CI new 61f7982b9 MINIFICPP-2227 Upgrade docker base image to alpine:3.18 The 6 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "add" were already present in the repository and have only been added to this reference. Summary of changes: .clang-tidy| 22 +- .github/workflows/ci.yml | 4 +- CONTROLLERS.md | 297 + CPPLINT.cfg| 2 +- PROCESSORS.md | 244 - cmake/BundledLibcURL.cmake | 2 + docker/Dockerfile | 2 +- .../aws/controllerservices/AWSCredentialsService.h | 4 +- .../AzureStorageCredentialsService.h | 3 +- extensions/civetweb/processors/ListenHTTP.h| 2 +- extensions/civetweb/protocols/RESTReceiver.cpp | 24 +- extensions/civetweb/tests/ListenHTTPTests.cpp | 130 - extensions/elasticsearch/PostElasticsearch.cpp | 2 +- extensions/expression-language/Expression.cpp | 55 ++-- .../tests/ExpressionLanguageTests.cpp | 7 +- .../GCPCredentialsControllerService.h | 3 +- extensions/gcp/tests/FetchGCSObjectTests.cpp | 7 +- .../tests/GCPCredentialsControllerServiceTests.cpp | 2 +- extensions/http-curl/client/HTTPClient.cpp | 66 +++-- extensions/http-curl/client/HTTPClient.h | 7 +- extensions/http-curl/processors/InvokeHTTP.cpp | 10 +- extensions/http-curl/processors/InvokeHTTP.h | 10 +- extensions/http-curl/protocols/RESTSender.cpp | 8 +- extensions/http-curl/protocols/RESTSender.h| 4 +- extensions/http-curl/sitetosite/HTTPProtocol.cpp | 11 +- extensions/http-curl/sitetosite/HTTPProtocol.h | 2 +- extensions/http-curl/tests/C2DebugBundleTest.cpp | 2 +- .../http-curl/tests/C2PropertiesUpdateTests.cpp| 1 + .../tests/ControllerServiceIntegrationTests.cpp| 2 +- extensions/http-curl/tests/HTTPSiteToSiteTests.cpp | 14 +- extensions/http-curl/tests/SiteToSiteRestTest.cpp | 1 - .../http-curl/tests/TimeoutHTTPSiteToSiteTests.cpp | 1 - .../http-curl/tests/unit/HTTPClientTests.cpp | 17 +- .../tests/unit/HTTPStreamingCallbackTests.cpp | 5 + extensions/libarchive/FocusArchiveEntry.cpp| 12 +- extensions/libarchive/UnfocusArchiveEntry.cpp | 14 +- extensions/librdkafka/KafkaConnection.cpp | 11 +- extensions/librdkafka/KafkaConnection.h| 4 +- extensions/librdkafka/PublishKafka.cpp | 25 +- extensions/lua/LuaScriptEngine.cpp | 5 + .../mqtt/processors/AbstractMQTTProcessor.cpp | 6 +- extensions/mqtt/processors/ConsumeMQTT.cpp | 12 +- extensions/mqtt/processors/PublishMQTT.cpp | 16 +- extensions/mqtt/tests/ConsumeMQTTTests.cpp | 5 + extensions/mqtt/tests/PublishMQTTTests.cpp | 5 + extensions/opc/src/fetchopc.cpp| 4 +- extensions/opc/src/opc.cpp | 91 --- extensions/opc/src/putopc.cpp | 14 +- .../SourceInitiatedSubscriptionListener.cpp| 32 +-- .../SourceInitiatedSubscriptionListener.h | 2 +- extensions/pcap/CapturePacket.cpp | 6 +- extensions/pcap/CapturePacket.h| 9 +- extensions/procfs/CpuStat.cpp | 4 +- extensions/procfs/DiskStat.cpp | 28 +- extensions/procfs/MemInfo.cpp | 2 +- extensions/procfs/NetDev.cpp | 4 +- extensions/python/PythonProcessor.cpp | 4 +- extensions/python/PythonScriptEngine.cpp | 6 +- .../python/tests/ExecutePythonProcessorTests.cpp | 6 + extensions/rocksdb-repos/RocksDbStream.cpp | 12 +- extensions/rocksdb-repos/RocksDbStream.h | 11 +- extensions/script/tests/ExecuteScriptTests.cpp | 2 +- extensions/sftp/client/SFTPClient.cpp | 76 -- extensions/sftp/client/SFTPClient.h| 2 +- extensions/sftp/processors/ListSFTP.cpp| 8 +- extensions/sftp/tests/FetchSFTPTests.cpp
[nifi-minifi-cpp] 05/06: MINIFICPP-2228 Fix clang job cache key name in CI
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit 393716b5963e132afb4c5fee1197de4c76313dd0 Author: Gabor Gyimesi AuthorDate: Mon Oct 2 13:57:40 2023 +0200 MINIFICPP-2228 Fix clang job cache key name in CI Closes #1666 Signed-off-by: Marton Szasz --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1cd99689c..b32b12fb4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -235,7 +235,7 @@ jobs: if: always() with: path: ~/.ccache - key: ubuntu-20.04-all-clang-ccache-${{github.ref}}-${{github.sha}} + key: ubuntu-22.04-all-clang-ccache-${{github.ref}}-${{github.sha}} - name: test id: test run: |
[nifi-minifi-cpp] 01/06: MINIFICPP-2191 Replace deprecated OpenSSL API calls
This is an automated email from the ASF dual-hosted git repository. szaszm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git commit a77c85727086a5e38aa14aaef22143acf70235ae Author: Ferenc Gerlits AuthorDate: Mon Oct 2 13:55:02 2023 +0200 MINIFICPP-2191 Replace deprecated OpenSSL API calls Closes #1656 Signed-off-by: Marton Szasz --- libminifi/include/utils/tls/CertificateUtils.h | 3 + libminifi/src/utils/tls/CertificateUtils.cpp | 119 ++ libminifi/test/unit/CertificateUtilsTests.cpp | 132 + 3 files changed, 213 insertions(+), 41 deletions(-) diff --git a/libminifi/include/utils/tls/CertificateUtils.h b/libminifi/include/utils/tls/CertificateUtils.h index 67ca46ee9..3c4a8ff6f 100644 --- a/libminifi/include/utils/tls/CertificateUtils.h +++ b/libminifi/include/utils/tls/CertificateUtils.h @@ -91,6 +91,9 @@ class WindowsCertStore { // Returns nullptr on errors X509_unique_ptr convertWindowsCertificate(PCCERT_CONTEXT certificate); +// Returns nullptr on errors, or if the input is not an RSA key pair +EVP_PKEY_unique_ptr convertWindowsRsaKeyPair(std::span data); + // Returns nullptr if the certificate has no associated private key, or the private key could not be extracted EVP_PKEY_unique_ptr extractPrivateKey(PCCERT_CONTEXT certificate); #endif // WIN32 diff --git a/libminifi/src/utils/tls/CertificateUtils.cpp b/libminifi/src/utils/tls/CertificateUtils.cpp index fb508a10a..5b8763a3a 100644 --- a/libminifi/src/utils/tls/CertificateUtils.cpp +++ b/libminifi/src/utils/tls/CertificateUtils.cpp @@ -18,14 +18,19 @@ #include "utils/tls/CertificateUtils.h" -#include -#include +#include "openssl/rsa.h" +#include "openssl/err.h" #ifdef WIN32 #include #pragma comment(lib, "ncrypt.lib") #pragma comment(lib, "Ws2_32.lib") + +#include "openssl/core_names.h" +#include "openssl/evp.h" +#include "openssl/param_build.h" +#include "openssl/ssl.h" #endif // WIN32 #include "utils/StringUtils.h" @@ -87,6 +92,76 @@ X509_unique_ptr convertWindowsCertificate(const PCCERT_CONTEXT certificate) { return X509_unique_ptr{d2i_X509(nullptr, _binary, certificate_length)}; } +struct OSSL_PARAM_BLD_deleter { + void operator()(OSSL_PARAM_BLD* param_builder) const { OSSL_PARAM_BLD_free(param_builder); } +}; +using OSSL_PARAM_BLD_unique_ptr = std::unique_ptr; + +struct OSSL_PARAM_deleter { + void operator()(OSSL_PARAM* params) const { OSSL_PARAM_free(params); } +}; +using OSSL_PARAM_unique_ptr = std::unique_ptr; + +struct EVP_PKEY_CTX_deleter { + void operator()(EVP_PKEY_CTX* pkey_context) const { EVP_PKEY_CTX_free(pkey_context); } +}; +using EVP_PKEY_CTX_unique_ptr = std::unique_ptr; + +EVP_PKEY_unique_ptr convertWindowsRsaKeyPair(std::span data) { + // https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/ns-bcrypt-bcrypt_rsakey_blob + auto const blob = reinterpret_cast(data.data()); + + if (blob->Magic == BCRYPT_RSAFULLPRIVATE_MAGIC) { +OSSL_PARAM_BLD_unique_ptr param_builder{OSSL_PARAM_BLD_new()}; +if (!param_builder) { return nullptr; } + +// n is the modulus common to both public and private key +const auto* const n = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB) + blob->cbPublicExp, blob->cbModulus, nullptr); +// e is the public exponent +const auto* const e = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB), blob->cbPublicExp, nullptr); +// d is the private exponent +const auto* const d = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB) + blob->cbPublicExp + blob->cbModulus + blob->cbPrime1 + + blob->cbPrime2 + blob->cbPrime1 + blob->cbPrime2 + blob->cbPrime1, blob->cbModulus, nullptr); + +if (OSSL_PARAM_BLD_push_BN(param_builder.get(), OSSL_PKEY_PARAM_RSA_N, n) == 0 || +OSSL_PARAM_BLD_push_BN(param_builder.get(), OSSL_PKEY_PARAM_RSA_E, e) == 0 || +OSSL_PARAM_BLD_push_BN(param_builder.get(), OSSL_PKEY_PARAM_RSA_D, d) == 0) { return nullptr; } + +// p and q are the first and second factor of n +const auto* const p = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB) + blob->cbPublicExp + blob->cbModulus, + blob->cbPrime1, nullptr); +const auto* const q = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB) + blob->cbPublicExp + blob->cbModulus + blob->cbPrime1, + blob->cbPrime2, nullptr); + +if (OSSL_PARAM_BLD_push_BN(param_builder.get(), OSSL_PKEY_PARAM_RSA_FACTOR1, p) == 0 || +OSSL_PARAM_BLD_push_BN(param_builder.get(), OSSL_PKEY_PARAM_RSA_FACTOR2, q) == 0) { return nullptr; } + +// dmp1, dmq1 and iqmp are the exponents and coefficient for CRT calculations +const auto* const dmp1 = BN_bin2bn(data.data() + sizeof(BCRYPT_RSAKEY_BLOB) + blob->cbPublicExp + blob->cbModulus + blob->cbPrime1 ++ blob->cbPrime2, blob->cbPrime1, nullptr); +