github-code-scanning[bot] commented on code in PR #362:
URL: https://github.com/apache/syncope/pull/362#discussion_r930879619
##########
core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/data/OIDCJWKSDataBinderImpl.java:
##########
@@ -51,22 +58,66 @@
}
@Override
- public OIDCJWKS create(final int size, final JWSAlgorithm algorithm) {
+ public OIDCJWKS create(final String jwksKeyId, final String jwksType,
final int jwksKeySize) {
+ JWK jwk;
try {
- OIDCJWKS jwks = entityFactory.newEntity(OIDCJWKS.class);
- RSAKey jwk = new RSAKeyGenerator(size).
- keyUse(KeyUse.SIGNATURE).
- keyID(SecureRandomUtils.generateRandomUUID().toString()).
- algorithm(new
com.nimbusds.jose.JWSAlgorithm(algorithm.name())).
- generate();
- jwks.setJson(JSONObjectUtils.toJSONString(new
JWKSet(jwk).toJSONObject(false)));
- return jwks;
- } catch (JOSEException e) {
+ switch (jwksType.trim().toLowerCase()) {
+ case "ec":
+ KeyPairGenerator gen = KeyPairGenerator.getInstance("EC");
Review Comment:
## Use of a potentially broken or risky cryptographic algorithm
Cryptographic algorithm [EC](1) may not be secure, consider using a
different algorithm.
[Show more
details](https://github.com/apache/syncope/security/code-scanning/1120)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]