src/java.base/share/classes/javax/crypto/JceSecurityManager.java
Print this page
rev 10700 : 8058845: Update JCE environment for build improvements
Reviewed-by: mullan, alanb, erikj, mchung, katleman
*** 1,7 ****
/*
! * Copyright (c) 1999, 2013, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 226,236 ****
defaultPolicy.getPermissionCollection(alg).elements();
return (CryptoPermission)enum_.nextElement();
}
// See bug 4341369 & 4334690 for more info.
! boolean isCallerTrusted() {
// Get the caller and its codebase.
Class<?>[] context = getClassContext();
URL callerCodeBase = null;
int i;
for (i=0; i<context.length; i++) {
--- 226,236 ----
defaultPolicy.getPermissionCollection(alg).elements();
return (CryptoPermission)enum_.nextElement();
}
// See bug 4341369 & 4334690 for more info.
! boolean isCallerTrusted(Provider provider) {
// Get the caller and its codebase.
Class<?>[] context = getClassContext();
URL callerCodeBase = null;
int i;
for (i=0; i<context.length; i++) {
*** 247,257 ****
if (TrustedCallersCache.contains(context[i])) {
return true;
}
// Check whether the caller is a trusted provider.
try {
! JceSecurity.verifyProviderJar(callerCodeBase);
} catch (Exception e2) {
return false;
}
TrustedCallersCache.addElement(context[i]);
return true;
--- 247,257 ----
if (TrustedCallersCache.contains(context[i])) {
return true;
}
// Check whether the caller is a trusted provider.
try {
! JceSecurity.verifyProviderJar(callerCodeBase, provider);
} catch (Exception e2) {
return false;
}
TrustedCallersCache.addElement(context[i]);
return true;