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

Filter missing non-compliant algorithms in FIPS mode #435

Merged
merged 1 commit into from
Oct 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import com.nimbusds.jose.crypto.RSASSASigner;
import com.nimbusds.jose.crypto.impl.AESCryptoProvider;
import com.nimbusds.jose.crypto.impl.ContentCryptoProvider;
import com.nimbusds.jose.crypto.impl.ECDHCryptoProvider;
import com.nimbusds.jose.crypto.impl.PasswordBasedCryptoProvider;
import com.nimbusds.jose.crypto.impl.RSACryptoProvider;
import edu.umd.cs.findbugs.annotations.NonNull;
Expand Down Expand Up @@ -39,14 +38,17 @@ public class OicAlgorithmValidatorFIPS140 {
// Init compliant JWE algorithms
JWESupportedAlgorithms.addAll(AESCryptoProvider.SUPPORTED_ALGORITHMS);
JWESupportedAlgorithms.addAll(RSACryptoProvider.SUPPORTED_ALGORITHMS);
JWESupportedAlgorithms.addAll(PasswordBasedCryptoProvider.SUPPORTED_ALGORITHMS);
// RSA1_5 is deprecated and not a compliant algorithm.
// ECDH seems to use its own key derivation function (ConcatKDF) and so not compliant. Not adding
// ECDHCryptoProvider.SUPPORTED_ALGORITHMS
JWESupportedAlgorithms.remove(JWEAlgorithm.RSA1_5);
JWESupportedAlgorithms.addAll(ECDHCryptoProvider.SUPPORTED_ALGORITHMS);
JWESupportedAlgorithms.addAll(PasswordBasedCryptoProvider.SUPPORTED_ALGORITHMS);

// Init complaint EncryptionMethods
// Init complaint EncryptionMethods and remove non-compliant algorithms
supportedEncryptionMethod.addAll(ContentCryptoProvider.SUPPORTED_ENCRYPTION_METHODS);
supportedEncryptionMethod.remove(EncryptionMethod.XC20P);
supportedEncryptionMethod.remove(EncryptionMethod.A128CBC_HS256_DEPRECATED);
supportedEncryptionMethod.remove(EncryptionMethod.A256CBC_HS512_DEPRECATED);
}

/**
Expand Down