Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove bc optional dependency #6051

Merged
merged 1 commit into from
Jun 18, 2024
Merged

fix: remove bc optional dependency #6051

merged 1 commit into from
Jun 18, 2024

Conversation

shawkins
Copy link
Contributor

Description

Removes the bc optional dependency

closes: #6008

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change
  • Chore (non-breaking change which doesn't affect codebase;
    test, version modification, documentation, etc.)

Checklist

  • Code contributed by me aligns with current project license: Apache 2.0
  • I Added CHANGELOG entry regarding this change
  • I have implemented unit tests to cover my changes
  • I have added/updated the javadocs and other documentation accordingly
  • No new bugs, code smells, etc. in SonarCloud report
  • I tested my code in Kubernetes
  • I tested my code in OpenShift

@rohanKanojia
Copy link
Member

@coopstah13 : Could you please review it to see if it meets your expectations?

@shawkins shawkins force-pushed the iss6008 branch 3 times, most recently from c4fd44a to 29c8c19 Compare June 12, 2024 13:58
@shawkins
Copy link
Contributor Author

@rohanKanojia unfortunately it still does have an issue. The remaining failures are related to:

java.security.InvalidAlgorithmParameterException: Curve not supported: secp256k1 (1.3.132.0.10)

JDK 15+ dropped support for secp256k1, but we're using a key from that algorithm for KubernetesClientLoadWithFipsProviderTest.

We can either:

  • Bring back a little bit of our reliance on bouncy castle - however we don't need an optional dependency. If the user installs bc / bcfips as a provider this will work if we instead call KeyPairGenerator.getInstance("EC", bc_provider)
  • Drop support for this EC - do we know what is in use for supported versions of kubernetes?

@coopstah13
Copy link

I think it would be acceptable to leave fall-back code with the optional dependency for supporting that. Basically, first you'd try to do it using JDK internals, but maybe catch the exception and fall back to the Callable code which lets it dynamically link to the BC dependency and leave BC as an optional dependency defined in your pom.

Appreciate the effort on this.

@shawkins
Copy link
Contributor Author

I've opted for suggesting that BC be installed as a provider if there's a problem with the algorithm. This approach means that we won't have any direct compile / runtime dependency on BC.

Comment on lines -163 to -168
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk18on</artifactId>
<optional>true</optional>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change seems odd to me

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? It's now a test dependency.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
73.2% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@manusa manusa added this to the 7.0.0 milestone Jun 18, 2024 — with automated-tasks
Copy link
Member

@manusa manusa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, nice job.
Thx!

@manusa manusa merged commit ee74ab9 into fabric8io:main Jun 18, 2024
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

remove bouncycastle dependency for EC key support
5 participants