8267397: AlgorithmId's OID cache is never refreshed

Reviewed-by: xuelei
This commit is contained in:
Valerie Peng 2021-06-14 20:40:26 +00:00
parent ee3015968d
commit f69e2d5651
3 changed files with 85 additions and 29 deletions

View file

@ -536,6 +536,11 @@ public class AlgorithmId implements Serializable, DerEncoder {
// oid string cache index'ed by algorithm name and oid strings
private static volatile Map<String,String> aliasOidsTable;
// called by sun.security.jca.Providers whenever provider list is changed
public static void clearAliasOidsTable() {
aliasOidsTable = null;
}
// returns the aliasOidsTable, lazily initializing it on first access.
private static Map<String,String> aliasOidsTable() {
// Double checked locking; safe because aliasOidsTable is volatile