-
Notifications
You must be signed in to change notification settings - Fork 601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrap IllegalArgumentException thrown by Base64 decoder #936
Wrap IllegalArgumentException thrown by Base64 decoder #936
Commits on Apr 9, 2024
-
Wrap IllegalArgumentException thrown by Base64 decoder
Some time ago, there had been `net.schmizz.sshj.common.Base64`. This class used to throw `IOException` in case of any problem. Although `IOException` isn't an appropriate class for indicating on parsing issues, a lot of code has been expecting `IOException` from Base64. Once, the old Base64 decoder was replaced with the one, bundled into Java 14 (see f35c2bd). Copy-paste elimination and switching to standard implementations is undoubtedly a good decision. Unfortunately, `java.util.Base64.Decoder` brought a pesky issue. It throws `IllegalArgumentException` in case of any problem. Since it is an unchecked exception, it was quite challenging to notice it. It's especially challenging because the error appears during processing malformed base64 strings. So, a lot of places in the code kept expecting `IOException`. Sudden `IllegalArgumentException` led to authentication termination in cases where everything used to work perfectly. One of such issues is already found and fixed: 03f8b22 This commit represents a work, based on revising every change made in f35c2bd. It should fix all other similar issues.
Configuration menu - View commit details
-
Copy full SHA for a25e447 - Browse repository at this point
Copy the full SHA a25e447View commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
Rename Base64DecodeError -> Base64DecodingException
Configuration menu - View commit details
-
Copy full SHA for 0834c09 - Browse repository at this point
Copy the full SHA 0834c09View commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
A better warning message in KnownHostMatchers
Configuration menu - View commit details
-
Copy full SHA for 1df0e48 - Browse repository at this point
Copy the full SHA 1df0e48View commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
A better error message in OpenSSHKeyFileUtil
Configuration menu - View commit details
-
Copy full SHA for 4e6ed16 - Browse repository at this point
Copy the full SHA 4e6ed16View commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
A better error message in OpenSSHKeyV1KeyFile
Configuration menu - View commit details
-
Copy full SHA for 5c054bc - Browse repository at this point
Copy the full SHA 5c054bcView commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
Get rid of unnecessary `throws IOException` in Base64Decoder
Configuration menu - View commit details
-
Copy full SHA for 6ad7e1e - Browse repository at this point
Copy the full SHA 6ad7e1eView commit details -
squash! Wrap IllegalArgumentException thrown by Base64 decoder
Better error messages in OpenSSHKeyFileUtil and PuTTYKeyFile
Configuration menu - View commit details
-
Copy full SHA for ce1cab2 - Browse repository at this point
Copy the full SHA ce1cab2View commit details