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

Fips and non-fips bc jars co-existence #714

Closed
RashmiSunil opened this issue May 21, 2020 · 8 comments
Closed

Fips and non-fips bc jars co-existence #714

RashmiSunil opened this issue May 21, 2020 · 8 comments

Comments

@RashmiSunil
Copy link

Hi Team,

My product is a legacy product and has many dependency with manyexternal jars and I see that few external jars are internally referring BlockCipher, SHA256Digest etc from bcprov-jdk-15on /bcprov-jdk16.

Now our product wants to support fips from bouncy castle (bc-fips-1.0.1).

According to your official document which stated :
"The bcfips provider jar itself has no external dependencies, but it cannot be used in the same JVM as the regular Bouncy Castle provider. The classes in the two jar files do not get along."

So how can I use bc-fips along with regular provider and what are all the alternatives that you can suggest ?
Since I must have bcprov-jdk as well.

Thanks and Regards,

@RashmiSunil RashmiSunil changed the title Fips and non-fips related jars co-existence Fips and non-fips bc jars co-existence May 21, 2020
@bcgit
Copy link
Collaborator

bcgit commented May 21, 2020

When you say FIPS support, do you mean you actually need the product to be FIPS compliant?

@RashmiSunil
Copy link
Author

Thats right. We want our product to be FIPS complaint. And we were using other provider and this provider has reached end of life so wants to move with Bouncy Castle for FIPS complaince.

@bcgit
Copy link
Collaborator

bcgit commented May 21, 2020

Okay, so where people need to use classes from the non-FIPS BC API together with the FIPS one the trick is to use the "org.spongycastle" approach.

There's one catch though, the application can't be FIPS compliant if it uses any of the cryptographic classes from the old BC API. Given some of the classes you have mentioned, you need to be making sure only the classes from the BC FIPS API are used and also those are used in accordance with the module's security policy.

@RashmiSunil
Copy link
Author

RashmiSunil commented May 21, 2020

Thanks for the quick reply and I have few follow-ups on it,

  1. I see that org.spongycastle approach is for android. Can this be used for desktop application?
  2. The BC API's that I have mentioned like SHA256Digest, BlockCipher are used by third party jar. Not by our product directly. So are you suggesting to check and move these classes to equivalent BC FIPS API's?
    I am afraid that this point is not in my hands as its third party jar usage.
    Please correct me if my understanding is wrong here.
  3. Does BC FIPS work on LINUX platform or do you have specific platform dependency for this?

@dghbc
Copy link

dghbc commented May 26, 2020

org.spongycastle is just a package name - it's first use was with the Android port, but the same idea can be applied to get two versions of BC running side by side in any environment.
On 2, yes you need to use the FIPS equivalents, the resulting product will not be FIPS compliant otherwise as it will using cryptographic services from a non-certified provider.
On 3, yes it works on Linux. Details of primary platforms and porting can be found in the security policy for the module:

https://downloads.bouncycastle.org/fips-java/BC-FJA-SecurityPolicy-1.0.2.pdf

@dghgit
Copy link
Contributor

dghgit commented Jun 27, 2020

Closed, assumed dealt with as no further feedback.

@dghgit dghgit closed this as completed Jun 27, 2020
@cid77
Copy link

cid77 commented Aug 20, 2022

Okay, so where people need to use classes from the non-FIPS BC API together with the FIPS one the trick is to use the "org.spongycastle" approach.

There's one catch though, the application can't be FIPS compliant if it uses any of the cryptographic classes from the old BC API. Given some of the classes you have mentioned, you need to be making sure only the classes from the BC FIPS API are used and also those are used in accordance with the module's security policy.

What's the "org.spongycastle" approach? I'm in a situation where both bc-fips and bc jars are in the classpath, but none of the bc providers (fips or non-fips) can be loaded. Is there a way to make it work? Thanks.

@dghgit
Copy link
Contributor

dghgit commented Aug 20, 2022

Recompile the API as org.spongycastle and give the provider the name "SC" rather than "BC".

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

No branches or pull requests

4 participants