mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-14 04:22:16 +00:00
[FIXED JENKINS-25937] Treat BadPaddingException as an unloadable key and continue.
This commit is contained in:
1 parent
e4c5c71042
commit
6318b8d800
2 files changed
+10
-1
No files matched your search
@@ -16,6 +16,7 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.SecureRandom;
|
||||
import javax.crypto.BadPaddingException;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
/**
|
||||
@@ -107,6 +108,12 @@ public class DefaultConfidentialStore extends ConfidentialStore {
|
||||
return verifyMagic(bytes);
|
||||
} catch (GeneralSecurityException e) {
|
||||
throw new IOException("Failed to load the key: "+key.getId(),e);
|
||||
} catch (IOException x) {
|
||||
if (x.getCause() instanceof BadPaddingException) {
|
||||
return null; // broken somehow
|
||||
} else {
|
||||
throw x;
|
||||
}
|
||||
} finally {
|
||||
IOUtils.closeQuietly(cis);
|
||||
IOUtils.closeQuietly(fis);
|
||||
|
||||
Reference in new issue
Block a user