mirror of https://github.com/jacekkow/keycloak-protocol-cas

Jacek Kowalski
10 hours ago fc40907a5866310f620d22c7f76ba5c148fafc07
src/main/java/org/keycloak/protocol/cas/endpoints/AbstractValidateEndpoint.java
@@ -330,7 +330,12 @@
    }
    private String hexDecode(String hex) {
        byte[] bytes = HexFormat.of().parseHex(hex);
        return new String(bytes, StandardCharsets.US_ASCII);
        try {
            byte[] bytes = HexFormat.of().parseHex(hex);
            return new String(bytes, StandardCharsets.US_ASCII);
        } catch (IllegalArgumentException e) {
            event.error(Errors.INVALID_CODE);
            throw new CASValidationException(CASErrorCode.INVALID_TICKET_SPEC, "Invalid format of the code", Response.Status.BAD_REQUEST);
        }
    }
}