From 52af8dbaff46191203b033f05a9fbc1ff0a46886 Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Fri, 17 Nov 2023 10:14:26 -0800 Subject: [PATCH] gpg.bc: Supress errorprone InsecureCryptoUsage From errorprone doc: "Dynamically constructed transformation strings are also flagged, as they may conceal an instance of ECB mode." https://errorprone.info/bugpattern/InsecureCryptoUsage Silence the message as a quick relief. Change-Id: I348f0fff0e3b24ce1f11917e849b4095b186d1f0 --- .../gpg/bc/internal/keys/OCBPBEProtectionRemoverFactory.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/OCBPBEProtectionRemoverFactory.java b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/OCBPBEProtectionRemoverFactory.java index 68f8a4555..3924d6859 100644 --- a/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/OCBPBEProtectionRemoverFactory.java +++ b/org.eclipse.jgit.gpg.bc/src/org/eclipse/jgit/gpg/bc/internal/keys/OCBPBEProtectionRemoverFactory.java @@ -75,6 +75,10 @@ public byte[] recoverKeyData(int encAlgorithm, byte[] key, .getSymmetricCipherName(encAlgorithm); byte[] decrypted = null; try { + // errorprone: "Dynamically constructed transformation + // strings are also flagged, as they may conceal an instance + // of ECB mode." + @SuppressWarnings("InsecureCryptoUsage") Cipher c = Cipher .getInstance(algorithmName + "/OCB/NoPadding"); //$NON-NLS-1$ SecretKey secretKey = new SecretKeySpec(key, algorithmName);