Skip to content

Commit

Permalink
Fix \r in private keys throwing decoding off
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed May 30, 2024
1 parent 8d14293 commit cd7057f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/net/neoforged/camelot/util/AuthUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AuthUtil {
* @throws IOException if the key could not be converted
*/
public static byte[] parsePKCS8(String input) throws IOException {
input = input.trim();
input = input.trim().replace("\r\n", "\n");
if (input.startsWith(PKCS8_KEY_START)) {
input = input.replace(PKCS8_KEY_START, "").replace(PKCS8_KEY_END, "").replaceAll("\\s", "");
return Base64.getDecoder().decode(input);
Expand Down

0 comments on commit cd7057f

Please sign in to comment.