You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "oscerd (via GitHub)" <gi...@apache.org> on 2026/10/13 08:56:58 UTC
[PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
oscerd opened a new pull request, #27768:
URL: https://github.com/apache/camel/pull/27768
Fixes [CAMEL-25603](https://issues.apache.org/jira/browse/CAMEL-25603).
A KEM `KeyGenerator` keeps the spec passed to `init()` until `generateKey()` reads it, and a `KeyAgreement` keeps its state from `init()` to `generateSecret()`. Neither is thread-safe, but:
- `PQCProducer` held one `KeyGenerator` for `generateSecretKeyEncapsulation` / `extractSecretKeyEncapsulation`, and one `KeyGenerator` plus one `KeyAgreement` for the hybrid KEM operations, for all exchanges.
- `HybridKEM` ran the init-to-result sequences on whatever instances it was given.
- `PQCDataFormat` cached one `KeyGenerator` at start, also when none was configured, and used it for every marshal and unmarshal.
Overlapping exchanges could get a result computed from another exchange's parameters, or fail (`AEADBadTagException`, or a `NullPointerException` from the Bouncy Castle SPI).
## Change
Same approach as CAMEL-24445 for `Signature`:
- `PQCProducer` creates a new `KeyGenerator` / `KeyAgreement` for every exchange when it created them itself. It keeps the `Provider` object of the generator created at start, so creating another one does not depend on the provider still being registered (`PQCEndpoint.doStop()` removes the Bouncy Castle providers from the JVM).
- A configured instance (an autowired registry bean, or the `PQCDefault*Material` defaults, which are shared JVM-wide) is used as-is, and each init-to-result sequence holds its monitor: in `PQCProducer`, in `HybridKEM` (so callers of the public utility are covered too) and in `PQCDataFormat`.
- `PQCDataFormat` creates a `KeyGenerator` for every operation unless one is configured; `doStart()` still fails fast on an unknown algorithm or provider. As a side effect, the documented `CamelPQCKemAlgorithm` header now applies to a started data format.
## Tests
New tests, all failing without the change:
- `PQCKemSharedKeyGeneratorIsolationTest`: a configured `KeyGenerator` shared by a generate and an extract endpoint. Overlapping extractions, and an overlapping generation and extraction, each keep their own result. A small test helper (`InterleavingProbe`, with `ProbedKeyGenerator` / `ProbedKeyAgreement` wrappers) holds the first caller between `init()` and the result and records whether another `init()` got in.
- `PQCKemConcurrentExtractionIsolationTest`: 8 threads x 40 extractions through one producer that created its own generator.
- `HybridKEMConcurrencyTest`: overlapping extractions and encapsulations on a shared `KeyAgreement` and `KeyGenerator`.
- `PQCDataFormatConcurrencyTest`: concurrent round trips through one data format with no `KeyGenerator` configured, and an overlapping marshal and unmarshal on a configured one.
`camel-pqc`: 239 tests, 0 failures, 1 skipped (pre-existing). Full reactor `clean install -DskipTests -DskipITs`: BUILD SUCCESS (703 modules); the only regenerated files are the catalog copies of the two pqc docs.
## Docs
- `pqc-component.adoc`: a note on how KEM `KeyGenerator` / `KeyAgreement` instances are used; registering a `KeyGenerator` bean is optional.
- `pqc-dataformat.adoc`: the "Caching KeyGenerator" tip is replaced, since a shared instance now runs one operation at a time.
- Upgrade guide notes for 4.24, 4.22.2 and 4.18.6, all on `main`. The change is meant to be backported to `camel-4.22.x` and `camel-4.18.x` (there is no hybrid KEM on 4.18.x).
_Claude Code on behalf of oscerd_
đ¤ Generated with [Claude Code](https://claude.com/claude-code)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #27768:
URL: https://github.com/apache/camel/pull/27768#discussion_r4257437189
##########
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCProducer.java:
##########
@@ -625,41 +635,75 @@ private static byte[] bodyToByteArray(Message message) throws InvalidPayloadExce
}
}
+ /**
+ * Returns the KEM {@link KeyGenerator} to use for a single exchange.
+ * <p>
+ * A KEM {@code KeyGenerator} keeps the spec passed to {@code init()} until {@code generateKey()} reads it and is
+ * not thread-safe, so the two calls of one exchange must not interleave with those of another. As with
+ * {@link #signerForExchange()}, an instance this producer created is simply created again, while a configured one -
+ * an autowired bean can be shared by every endpoint, and {@code PQCDefault*Material.keyGenerator} JVM-wide - is
+ * handed back as-is, and the caller serializes on whatever it gets.
+ */
+ private KeyGenerator keyGeneratorForExchange() throws NoSuchAlgorithmException {
+ if (keyGeneratorAlgorithm == null) {
+ return keyGenerator;
+ }
+ return KeyGenerator.getInstance(keyGeneratorAlgorithm, keyGeneratorProvider);
+ }
Review Comment:
Optional, could be a follow-up: the producer treats any `KeyGenerator` it finds in the configuration as configured. But `PQCComponent` puts one there itself in two cases:
- With `parameterSpec` and no key material, `configureParameterSpecMaterial()` does `configuration.setKeyGenerator(KeyGenerator.getInstance(...))`. That endpoint now runs all its KEM exchanges one at a time, although nobody configured that instance.
- With no key material at all, `createEndpoint()` sets `PQCDefault*Material.keyGenerator`. That lock is JVM-wide, shared by every `pqc` KEM endpoint that uses the default material.
A `KeyGenerator` holds no key, so the component could set only the `keyPair` in those two places. The producer would then create its own generator for each exchange from `keyEncapsulationAlgorithm`. The same applies to the `Signature` set in `configureParameterSpecMaterial()` from CAMEL-24445. This is not a correctness problem, and the upgrade guide already describes the default-material case, so it is fine to leave it out of this PR.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27768:
URL: https://github.com/apache/camel/pull/27768#issuecomment-6144451246
<!-- ci-tested-modules -->
:test_tube: **CI tested the following changed modules:**
- `catalog/camel-catalog`
- `components/camel-pqc`
- `docs`
---
<details><summary>:microscope: Scalpel shadow comparison â Scalpel: 8 of 703 tested, 25 compile-only â current: 8 all tested</summary>
[Maveniverse Scalpel](https://github.com/maveniverse/scalpel) detected **8 affected modules** (current approach: 8).
**Skip-tests mode would test 8 modules** (3 direct + 7 downstream), **skip tests for 25** (generated code, meta-modules)
<details><summary>Modules Scalpel would test (8)</summary>
- `camel-jbang-mcp` â downstream of org.apache.camel:camel-catalog
- `camel-jbang-plugin-mcp` â downstream of org.apache.camel:camel-jbang-core
- `camel-jbang-plugin-tui` â downstream of org.apache.camel:camel-catalog
- `camel-jbang-plugin-validate` â downstream of org.apache.camel:camel-yaml-dsl-validator
- `camel-launcher-container` â downstream of org.apache.camel:camel-launcher
- `camel-pqc` â components/camel-pqc/src/main/docs/pqc-component.adoc, components/camel-pqc/src/main/docs/pqc-dataformat.adoc, components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCProducer.java, components/camel-pqc/src/main/java/org/apache/camel/component/pqc/crypto/hybrid/HybridKEM.java, components/camel-pqc/src/main/java/org/apache/camel/component/pqc/dataformat/PQCDataFormat.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/InterleavingProbe.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemConcurrentExtractionIsolationTest.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/PQCKemSharedKeyGeneratorIsolationTest.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/ProbedKeyAgreement.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/ProbedKeyGenerator.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/crypto/hybrid/HybridKEMConcur
rencyTest.java, components/camel-pqc/src/test/java/org/apache/camel/component/pqc/dataformat/PQCDataFormatConcurrencyTest.java
- `camel-yaml-dsl-validator` â downstream of org.apache.camel:camel-catalog
- `camel-yaml-dsl-validator-maven-plugin` â downstream of org.apache.camel:camel-yaml-dsl-validator
</details>
<details><summary>Modules with tests skipped (25)</summary>
- `apache-camel`
- `camel-allcomponents`
- `camel-catalog-console`
- `camel-catalog-maven`
- `camel-catalog-suggest`
- `camel-componentdsl`
- `camel-endpointdsl`
- `camel-endpointdsl-support`
- `camel-itest`
- `camel-jbang-core`
- `camel-jbang-it`
- `camel-jbang-main`
- `camel-jbang-plugin-edit`
- `camel-jbang-plugin-generate`
- `camel-jbang-plugin-kubernetes`
- `camel-jbang-plugin-test`
- `camel-kamelet-main`
- `camel-launcher`
- `camel-report-maven-plugin`
- `camel-route-parser`
- `camel-yaml-dsl`
- `camel-yaml-dsl-deserializers`
- `camel-yaml-dsl-maven-plugin`
- `coverage`
- `dummy-component`
</details>
> :information_source: Shadow mode â Scalpel observes but does not affect test execution. [Learn more](https://github.com/maveniverse/scalpel)
</details>
<details><summary>All tested modules (35 modules, 4m 47s total)</summary>
**Total reactor time:** 4m 47s
| Module | Duration | Status |
| --- | --- | --- |
| Camel :: Launcher | 42.2s | SUCCESS |
| Camel :: JBang :: MCP | 35.0s | SUCCESS |
| Camel :: Component DSL | 23.6s | SUCCESS |
| Camel :: Catalog :: Camel Catalog | 22.7s | SUCCESS |
| Camel :: YAML DSL :: Validator | 19.1s | SUCCESS |
| Camel :: YAML DSL | 19.0s | SUCCESS |
| Camel :: JBang :: Plugin :: Kubernetes | 16.7s | SUCCESS |
| Camel :: JBang :: Plugin :: Validate | 16.7s | SUCCESS |
| Camel :: Docs | 15.1s | SUCCESS |
| Camel :: Kamelet Main | 11.8s | SUCCESS |
| Camel :: JBang :: Plugin :: Testing | 11.1s | SUCCESS |
| Camel :: YAML DSL :: Deserializers | 8.1s | SUCCESS |
| Camel :: Catalog :: Camel Route Parser | 7.7s | SUCCESS |
| Camel :: Catalog :: Camel Report Maven Plugin | 6.9s | SUCCESS |
| Camel :: All Components Sync point | 4.7s | SUCCESS |
| Camel :: YAML DSL :: Validator Maven Plugin | 4.7s | SUCCESS |
| Camel :: YAML DSL :: Maven Plugins | 3.6s | SUCCESS |
| Camel :: Catalog :: Suggest (deprecated) | 3.1s | SUCCESS |
| Camel :: Catalog :: Maven | 2.6s | SUCCESS |
| Camel :: JBang :: Integration tests | 2.0s | SUCCESS |
| Camel :: JBang :: Plugin :: Edit | 1.7s | SUCCESS |
| Camel :: Assembly | 1.6s | SUCCESS |
| Camel :: JBang :: Plugin :: MCP | 1.3s | SUCCESS |
| Camel :: Coverage | 1.2s | SUCCESS |
| Camel :: Catalog :: Dummy Component | 1.1s | SUCCESS |
| Camel :: JBang :: Plugin :: Generate | 1.0s | SUCCESS |
| Camel :: Catalog :: Console | 0.8s | SUCCESS |
| Camel :: Endpoint DSL :: Support | 0.8s | SUCCESS |
| Camel :: JBang :: Main | 0.7s | SUCCESS |
| Camel :: Launcher :: Container | 0.7s | SUCCESS |
| Camel :: Endpoint DSL | n/a | |
| Camel :: Integration Tests | n/a | |
| Camel :: JBang :: Core | n/a | |
| Camel :: JBang :: Plugin :: TUI | n/a | |
| Camel :: PQC | n/a | |
**Top 20 slowest modules:**
- `Camel :: Launcher` (42.2s)
- `Camel :: JBang :: MCP` (35.0s)
- `Camel :: Component DSL` (23.6s)
- `Camel :: Catalog :: Camel Catalog` (22.7s)
- `Camel :: YAML DSL :: Validator` (19.1s)
- `Camel :: YAML DSL` (19.0s)
- `Camel :: JBang :: Plugin :: Kubernetes` (16.7s)
- `Camel :: JBang :: Plugin :: Validate` (16.7s)
- `Camel :: Docs` (15.1s)
- `Camel :: Kamelet Main` (11.8s)
- `Camel :: JBang :: Plugin :: Testing` (11.1s)
- `Camel :: YAML DSL :: Deserializers` (8.1s)
- `Camel :: Catalog :: Camel Route Parser` (7.7s)
- `Camel :: Catalog :: Camel Report Maven Plugin` (6.9s)
- `Camel :: All Components Sync point` (4.7s)
- `Camel :: YAML DSL :: Validator Maven Plugin` (4.7s)
- `Camel :: YAML DSL :: Maven Plugins` (3.6s)
- `Camel :: Catalog :: Suggest (deprecated)` (3.1s)
- `Camel :: Catalog :: Maven` (2.6s)
- `Camel :: JBang :: Integration tests` (2.0s)
</details>
---
:gear: [View full build and test results](https://github.com/apache/camel/actions/runs/38372809864)
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #27768:
URL: https://github.com/apache/camel/pull/27768#issuecomment-6167752046
@oscerd could you rebase this on main? It now conflicts in `docs/user-manual/modules/ROOT/pages/camel-4x-upgrade-guide-4_24.adoc`, because other PRs merged today added upgrade-guide sections next to the ones this PR adds. Nothing else is blocking, so I'll merge once it's rebased and CI is green.
_Claude Code on behalf of davsclaus_
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "gnodet (via GitHub)" <gi...@apache.org>.
gnodet commented on PR #27768:
URL: https://github.com/apache/camel/pull/27768#issuecomment-6167674120
<!-- camel-backport-bot -->
### đ Backport Bot
This bugfix targets `main` and may need porting to:
- `camel-4.22.x`
Add a `port/<branch>` label to automatically create a backport PR for that branch.
Backport PRs will be created automatically on merge (once a port label is added). Comment `/port` to create them immediately.
âšī¸ If you push additional commits after `/port`, use `/port` again to update the port PRs.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on PR #27768:
URL: https://github.com/apache/camel/pull/27768#issuecomment-6164010351
Thanks for the re-review. I have left the `port/*` labels off on purpose, because both backports need a hand port rather than a straight cherry-pick:
- `camel-4.22.x`: the code cherry-picks cleanly, but the three upgrade-guide files stay on `main`. The 4.22.2 and 4.18.6 notes are already in this PR, as the guide policy asks, so the port leaves them out.
- `camel-4.18.x`: `HybridKEM` and the hybrid KEM operations do not exist there, `PQCProducer` and `PQCDataFormat` differ, and the module's tests use JUnit 5, so a straight cherry-pick does not compile.
I will open both backport PRs by hand once this one is merged.
_Claude Code on behalf of oscerd_
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on code in PR #27768:
URL: https://github.com/apache/camel/pull/27768#discussion_r4268253471
##########
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCProducer.java:
##########
@@ -625,41 +635,75 @@ private static byte[] bodyToByteArray(Message message) throws InvalidPayloadExce
}
}
+ /**
+ * Returns the KEM {@link KeyGenerator} to use for a single exchange.
+ * <p>
+ * A KEM {@code KeyGenerator} keeps the spec passed to {@code init()} until {@code generateKey()} reads it and is
+ * not thread-safe, so the two calls of one exchange must not interleave with those of another. As with
+ * {@link #signerForExchange()}, an instance this producer created is simply created again, while a configured one -
+ * an autowired bean can be shared by every endpoint, and {@code PQCDefault*Material.keyGenerator} JVM-wide - is
+ * handed back as-is, and the caller serializes on whatever it gets.
+ */
+ private KeyGenerator keyGeneratorForExchange() throws NoSuchAlgorithmException {
+ if (keyGeneratorAlgorithm == null) {
+ return keyGenerator;
+ }
+ return KeyGenerator.getInstance(keyGeneratorAlgorithm, keyGeneratorProvider);
+ }
+
+ /**
+ * The {@link KeyAgreement} counterpart of {@link #keyGeneratorForExchange()}, used by the hybrid KEM operations.
+ */
+ private KeyAgreement classicalKeyAgreementForExchange() throws NoSuchAlgorithmException {
+ if (classicalKeyAgreementAlgorithm == null) {
+ return classicalKeyAgreement;
+ }
+ return KeyAgreement.getInstance(classicalKeyAgreementAlgorithm);
+ }
Review Comment:
Done in fc0a7f68e9a3: `classicalKeyAgreementForExchange()` now has a comment. I worded it a little differently from the suggestion. The instance is created the same way as at start, without naming a provider, so the JDK picks a provider that accepts the key when `init()` is called. That is why there is no `Provider` object to keep, and naming one here would change which provider handles the classical keys.
I left out "they come from JDK-bundled providers, not from Bouncy Castle". With delayed provider selection the JDK can pick Bouncy Castle when it is registered and accepts the key, so that part is not guaranteed.
_Claude Code on behalf of oscerd_
##########
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCProducer.java:
##########
@@ -625,41 +635,75 @@ private static byte[] bodyToByteArray(Message message) throws InvalidPayloadExce
}
}
+ /**
+ * Returns the KEM {@link KeyGenerator} to use for a single exchange.
+ * <p>
+ * A KEM {@code KeyGenerator} keeps the spec passed to {@code init()} until {@code generateKey()} reads it and is
+ * not thread-safe, so the two calls of one exchange must not interleave with those of another. As with
+ * {@link #signerForExchange()}, an instance this producer created is simply created again, while a configured one -
+ * an autowired bean can be shared by every endpoint, and {@code PQCDefault*Material.keyGenerator} JVM-wide - is
+ * handed back as-is, and the caller serializes on whatever it gets.
+ */
+ private KeyGenerator keyGeneratorForExchange() throws NoSuchAlgorithmException {
+ if (keyGeneratorAlgorithm == null) {
+ return keyGenerator;
+ }
+ return KeyGenerator.getInstance(keyGeneratorAlgorithm, keyGeneratorProvider);
+ }
Review Comment:
Thanks for checking both paths. I agree it is worth doing, and I have left it out of this PR: it is tracked in [CAMEL-25624](https://issues.apache.org/jira/browse/CAMEL-25624), for `main` only.
- It changes no result. The instances the component wires are only used one at a time now.
- It also covers the `Signature` instances that `configureParameterSpecMaterial()` and the default materials wire (from CAMEL-24445). The hybrid default materials also create their classical `KeyAgreement` and `Signature` with the `BC` provider, while the producer names none, so the change needs its own look.
- Keeping this PR to the fix keeps the 4.22.x and 4.18.x backports the same change.
_Claude Code on behalf of oscerd_
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "gnodet-bot (via GitHub)" <gi...@apache.org>.
gnodet-bot commented on code in PR #27768:
URL: https://github.com/apache/camel/pull/27768#discussion_r4256727770
##########
components/camel-pqc/src/main/java/org/apache/camel/component/pqc/PQCProducer.java:
##########
@@ -625,41 +635,75 @@ private static byte[] bodyToByteArray(Message message) throws InvalidPayloadExce
}
}
+ /**
+ * Returns the KEM {@link KeyGenerator} to use for a single exchange.
+ * <p>
+ * A KEM {@code KeyGenerator} keeps the spec passed to {@code init()} until {@code generateKey()} reads it and is
+ * not thread-safe, so the two calls of one exchange must not interleave with those of another. As with
+ * {@link #signerForExchange()}, an instance this producer created is simply created again, while a configured one -
+ * an autowired bean can be shared by every endpoint, and {@code PQCDefault*Material.keyGenerator} JVM-wide - is
+ * handed back as-is, and the caller serializes on whatever it gets.
+ */
+ private KeyGenerator keyGeneratorForExchange() throws NoSuchAlgorithmException {
+ if (keyGeneratorAlgorithm == null) {
+ return keyGenerator;
+ }
+ return KeyGenerator.getInstance(keyGeneratorAlgorithm, keyGeneratorProvider);
+ }
+
+ /**
+ * The {@link KeyAgreement} counterpart of {@link #keyGeneratorForExchange()}, used by the hybrid KEM operations.
+ */
+ private KeyAgreement classicalKeyAgreementForExchange() throws NoSuchAlgorithmException {
+ if (classicalKeyAgreementAlgorithm == null) {
+ return classicalKeyAgreement;
+ }
+ return KeyAgreement.getInstance(classicalKeyAgreementAlgorithm);
+ }
Review Comment:
đĄ **Nit:** `classicalKeyAgreementForExchange()` creates a new `KeyAgreement` via `getInstance(algorithm)` without saving the provider, unlike `keyGeneratorForExchange()` which saves `keyGeneratorProvider`. This is intentionally correct â classical KA algorithms (X25519, ECDH) come from JDK-bundled providers (SunEC), not from Bouncy Castle which `PQCEndpoint.doStop()` removes from the JVM. Add a brief comment so a future maintainer doesn't "fix" it to match `keyGeneratorForExchange()` and accidentally hard-wire a BC provider for classical algorithms.
```suggestion
private KeyAgreement classicalKeyAgreementForExchange() throws NoSuchAlgorithmException {
if (classicalKeyAgreementAlgorithm == null) {
return classicalKeyAgreement;
}
// No provider saved: classical KA algorithms (X25519, ECDH) come from JDK-bundled providers,
// not from Bouncy Castle â so no BC provider to preserve across PQCEndpoint.doStop().
return KeyAgreement.getInstance(classicalKeyAgreementAlgorithm);
}
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #27768:
URL: https://github.com/apache/camel/pull/27768#issuecomment-6142008551
:star2: Thank you for your contribution to the Apache Camel project! :star2:
:robot: CI automation will test this PR automatically.
:camel: Apache Camel Committers, please review the following items:
* First-time contributors **require MANUAL approval** for the GitHub Actions to run
* You can use the command `/component-test (camel-)component-name1 (camel-)component-name2..` to request a test from the test bot although they are normally detected and executed by CI.
* You can label PRs using `skip-tests` and `test-dependents` to fine-tune the checks executed by this PR.
* Build and test logs are available in the summary page. **Only** [Apache Camel committers](https://camel.apache.org/community/team/#committers) have access to the summary.
:warning: Be careful when sharing logs. Review their contents before sharing them publicly.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-25603: camel-pqc - do not share a KeyGenerator or KeyAgreement across concurrent KEM operations [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus merged PR #27768:
URL: https://github.com/apache/camel/pull/27768
--
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.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org