Skip to content

Commit cddafca

Browse files
committed
Make stricter.
1 parent 21d7b39 commit cddafca

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/src/main/java/ch/cyberduck/core/io/Checksum.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ public static Checksum parse(final String hash) {
8080
if(StringUtils.isBlank(hash)) {
8181
return Checksum.NONE;
8282
}
83-
// Check for Base64 with propper padding
84-
if(hash.matches("^[A-Za-z0-9+/]+=*$") && hash.length() % 4 == 0) {
83+
// Check for Base64 with proper padding
84+
if(hash.matches("^[A-Za-z0-9+/]+={0,2}$") && hash.length() % 4 == 0) {
8585
final Checksum result = parseHex(Hex.encodeHexString(Base64.decodeBase64(hash)));
8686
if(result != Checksum.NONE) {
8787
return new Checksum(result.algorithm, result.hex, hash);

0 commit comments

Comments
 (0)