-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathMain.java
More file actions
31 lines (21 loc) · 844 Bytes
/
Main.java
File metadata and controls
31 lines (21 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.srcclr;
import org.apache.commons.fileupload.MultipartStream;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.mindrot.jbcrypt.BCrypt;
import org.springframework.web.util.UriUtils;
import java.io.ByteArrayInputStream;
public class Main {
public static void main(String[] args) throws Exception {
String candidate = args[0];
String hashed = BCrypt.hashpw(candidate, BCrypt.gensalt(12));
BCrypt.checkpw(candidate, hashed);
filterXMLSignature();
// Update Advisor: changed in the upgrade from Spring Web 3.1.1.RELEASE to 3.2.15.RELEASE
UriUtils.encodeFragment("", "");
}
private static void filterXMLSignature() {
byte[] bytes = new byte[256];
new MultipartStream(new ByteArrayInputStream(bytes), bytes);
new XMLSignatureInput(bytes).addNodeFilter(null);
}
}