8325506: Ensure randomness is only read from provided SecureRandom object

Reviewed-by: kdriver, valeriep
This commit is contained in:
Weijun Wang 2024-02-26 21:52:40 +00:00
parent 0963a4e9a1
commit b87d9cf2c9
6 changed files with 551 additions and 5 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -297,6 +297,9 @@ public class SignatureUtil {
} else {
keyAlgorithm = signatureAlgorithm.substring(with + 4);
}
if (keyAlgorithm.endsWith("INP1363FORMAT")) {
keyAlgorithm = keyAlgorithm.substring(0, keyAlgorithm.length() - 13);
}
if (keyAlgorithm.equalsIgnoreCase("ECDSA")) {
keyAlgorithm = "EC";
}