mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-13 12:02:20 +00:00
Narrow the suppression.
And add TODO connected with JENKINS tickets for relevant issues.
This commit is contained in:
1 parent
2241771c9a
commit
348a26f77e
18 files changed
+127
-52
No files matched your search
@@ -589,6 +589,8 @@ public class Util {
|
||||
/**
|
||||
* Computes MD5 digest of the given input stream.
|
||||
*
|
||||
* This method should only be used for non-security applications where the MD5 weakness is not a problem.
|
||||
*
|
||||
* @param source
|
||||
* The stream will be closed by this method at the end of this method.
|
||||
* @return
|
||||
@@ -596,11 +598,9 @@ public class Util {
|
||||
* @see DigestUtils#md5Hex(InputStream)
|
||||
*/
|
||||
@Nonnull
|
||||
@SuppressFBWarnings(value = "WEAK_MESSAGE_DIGEST_MD5", justification =
|
||||
"This method should only be used for non-security applications where their weakness is not a problem.")
|
||||
public static String getDigestOf(@Nonnull InputStream source) throws IOException {
|
||||
try {
|
||||
MessageDigest md5 = MessageDigest.getInstance("MD5");
|
||||
MessageDigest md5 = getMd5();
|
||||
DigestInputStream in = new DigestInputStream(source, md5);
|
||||
// Note: IOUtils.copy() buffers the input internally, so there is no
|
||||
// need to use a BufferedInputStream.
|
||||
@@ -620,6 +620,13 @@ public class Util {
|
||||
*/
|
||||
}
|
||||
|
||||
// TODO JENKINS-60563 remove MD5 from all usages in Jenkins
|
||||
@SuppressFBWarnings(value = "WEAK_MESSAGE_DIGEST_MD5", justification =
|
||||
"This method should only be used for non-security applications where the MD5 weakness is not a problem.")
|
||||
private static MessageDigest getMd5() throws NoSuchAlgorithmException {
|
||||
return MessageDigest.getInstance("MD5");
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
public static String getDigestOf(@Nonnull String text) {
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user