mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8148188: Enhance the security libraries to record events of interest
Reviewed-by: egahlin, mullan, weijun, xuelei
This commit is contained in:
parent
dc260a5369
commit
73ad9c4a00
35 changed files with 2617 additions and 8 deletions
|
@ -30,6 +30,8 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
import java.io.*;
|
||||
import java.net.URL;
|
||||
|
||||
import jdk.internal.event.EventHelper;
|
||||
import jdk.internal.event.SecurityPropertyModificationEvent;
|
||||
import jdk.internal.access.SharedSecrets;
|
||||
import jdk.internal.util.StaticProperty;
|
||||
import sun.security.util.Debug;
|
||||
|
@ -792,9 +794,19 @@ public final class Security {
|
|||
* @see java.security.SecurityPermission
|
||||
*/
|
||||
public static void setProperty(String key, String datum) {
|
||||
check("setProperty."+key);
|
||||
check("setProperty." + key);
|
||||
props.put(key, datum);
|
||||
invalidateSMCache(key); /* See below. */
|
||||
|
||||
SecurityPropertyModificationEvent spe = new SecurityPropertyModificationEvent();
|
||||
// following is a no-op if event is disabled
|
||||
spe.key = key;
|
||||
spe.value = datum;
|
||||
spe.commit();
|
||||
|
||||
if (EventHelper.isLoggingSecurity()) {
|
||||
EventHelper.logSecurityPropertyEvent(key, datum);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue