Skip to content
Permalink
Browse files
8264681: Use the blessed modifier order in java.security
Reviewed-by: mullan, shade
  • Loading branch information
alblue authored and shipilev committed Apr 14, 2021
1 parent ea5c55a commit ebbce91e79ff5e145166b01310d4a1ebbbbd5178
Show file tree
Hide file tree
Showing 53 changed files with 160 additions and 160 deletions.
@@ -56,7 +56,7 @@ public final class EncryptionKey implements SecretKey {
*
* @serial
*/
final private KeyImpl key;
private final KeyImpl key;

private transient boolean destroyed = false;

@@ -49,9 +49,9 @@
*/
public final class KerberosCredMessage implements Destroyable {

final private KerberosPrincipal sender;
final private KerberosPrincipal recipient;
final private byte[] message;
private final KerberosPrincipal sender;
private final KerberosPrincipal recipient;
private final byte[] message;

private boolean destroyed = false;

@@ -110,22 +110,22 @@ public final class ServicePermission extends Permission
/**
* Initiate a security context to the specified service
*/
private final static int INITIATE = 0x1;
private static final int INITIATE = 0x1;

/**
* Accept a security context
*/
private final static int ACCEPT = 0x2;
private static final int ACCEPT = 0x2;

/**
* All actions
*/
private final static int ALL = INITIATE|ACCEPT;
private static final int ALL = INITIATE|ACCEPT;

/**
* No actions.
*/
private final static int NONE = 0x0;
private static final int NONE = 0x0;

// the actions mask
private transient int mask;
@@ -93,7 +93,7 @@ public class GSSNameImpl implements GSSName {
* its internal name type and getStringNameType() output are
* always the new value.
*/
final static Oid oldHostbasedServiceName;
static final Oid oldHostbasedServiceName;

static {
Oid tmp = null;
@@ -32,7 +32,7 @@
* info about what triggers the JGSS calls.
*/
public class HttpCaller extends GSSCaller {
final private HttpCallerInfo hci;
private final HttpCallerInfo hci;

public HttpCaller(HttpCallerInfo hci) {
super("HTTP_CLIENT");
@@ -116,7 +116,7 @@ public final class ProviderList {
new HashMap<PreferencesEntry, MechanismFactory>(5);
private HashSet<Oid> mechs = new HashSet<Oid>(5);

final private GSSCaller caller;
private final GSSCaller caller;

public ProviderList(GSSCaller caller, boolean useNative) {
this.caller = caller;
@@ -124,7 +124,7 @@ class Krb5Context implements GSSContextSpi {
private Credentials serviceCreds;
private KrbApReq apReq;
Ticket serviceTicket;
final private GSSCaller caller;
private final GSSCaller caller;
private static final boolean DEBUG = Krb5Util.DEBUG;

/**
@@ -60,7 +60,7 @@ public final class Krb5MechFactory implements MechanismFactory {
GSSName.NT_EXPORT_NAME,
NT_GSS_KRB5_PRINCIPAL};

final private GSSCaller caller;
private final GSSCaller caller;

private static Krb5CredElement getCredFromSubject(GSSNameSpi name,
boolean initiate)
@@ -79,7 +79,7 @@ public class SpNegoContext implements GSSContextSpi {
private Oid internal_mech = null;

// the SpNegoMechFactory that creates this context
final private SpNegoMechFactory factory;
private final SpNegoMechFactory factory;

// debug property
static final boolean DEBUG = GetBooleanAction
@@ -45,9 +45,9 @@ public static NetClient getInstance(String protocol, String hostname, int port,
}
}

abstract public void send(byte[] data) throws IOException;
abstract public byte[] receive() throws IOException;
abstract public void close() throws IOException;
public abstract void send(byte[] data) throws IOException;
public abstract byte[] receive() throws IOException;
public abstract void close() throws IOException;
}

class TCPClient extends NetClient {
@@ -56,9 +56,9 @@
*/

public class PAForUserEnc {
final public PrincipalName name;
final private EncryptionKey key;
final public static String AUTH_PACKAGE = "Kerberos";
public final PrincipalName name;
private final EncryptionKey key;
public static final String AUTH_PACKAGE = "Kerberos";

public PAForUserEnc(PrincipalName name, EncryptionKey key) {
this.name = name;
@@ -48,7 +48,7 @@ final class ReferralsCache {
private static Map<ReferralCacheKey, Map<String, ReferralCacheEntry>>
referralsMap = new HashMap<>();

static private final class ReferralCacheKey {
private static final class ReferralCacheKey {
private PrincipalName cname;
private PrincipalName sname;
ReferralCacheKey (PrincipalName cname, PrincipalName sname) {
@@ -53,7 +53,7 @@ public final class Des {
// string-to-key encoding. When set, the specified charset
// name is used. Otherwise, the system default charset.

private final static String CHARSET = GetPropertyAction
private static final String CHARSET = GetPropertyAction
.privilegedGetProperty("sun.security.krb5.msinterop.des.s2kcharset");

private static final long[] bad_keys = {
@@ -64,7 +64,7 @@ public KrbDataInputStream(InputStream is){
* @throws IOException if there are not enough bytes or it represents
* a negative value
*/
final public int readLength4() throws IOException {
public final int readLength4() throws IOException {
int len = read(4);
if (len < 0) {
throw new IOException("Invalid encoding");
@@ -48,7 +48,7 @@
*
* @author Rosanna Lee
*/
final public class ClientFactoryImpl implements SaslClientFactory {
public final class ClientFactoryImpl implements SaslClientFactory {
private static final String[] myMechs = {
"EXTERNAL",
"CRAM-MD5",
@@ -141,7 +141,7 @@ protected void finalize() {
clearPassword();
}

static private final int MD5_BLOCKSIZE = 64;
private static final int MD5_BLOCKSIZE = 64;
/**
* Hashes its input arguments according to HMAC-MD5 (RFC 2104)
* and returns the resulting digest in its ASCII representation.
@@ -155,7 +155,7 @@ protected void finalize() {
* opad is the byte 0x5c repeated 64 times
* text is the data to be protected
*/
final static String HMAC_MD5(byte[] key, byte[] text)
static final String HMAC_MD5(byte[] key, byte[] text)
throws NoSuchAlgorithmException {

MessageDigest md5 = MessageDigest.getInstance("MD5");
@@ -40,7 +40,7 @@
*
* @author Rosanna Lee
*/
final public class ServerFactoryImpl implements SaslServerFactory {
public final class ServerFactoryImpl implements SaslServerFactory {
private static final String[] myMechs = {
"CRAM-MD5", //
};
@@ -272,7 +272,7 @@ public Object getNegotiatedProperty(String propName) {
*/

/** This array maps the characters to their 6 bit values */
private final static char[] pem_array = {
private static final char[] pem_array = {
// 0 1 2 3 4 5 6 7
'A','B','C','D','E','F','G','H', // 0
'I','J','K','L','M','N','O','P', // 1
@@ -807,9 +807,9 @@ private static void extractDirective(String key, byte[] value,
*/
class DigestIntegrity implements SecurityCtx {
/* Used for generating integrity keys - specified in RFC 2831*/
static final private String CLIENT_INT_MAGIC = "Digest session key to " +
private static final String CLIENT_INT_MAGIC = "Digest session key to " +
"client-to-server signing key magic constant";
static final private String SVR_INT_MAGIC = "Digest session key to " +
private static final String SVR_INT_MAGIC = "Digest session key to " +
"server-to-client signing key magic constant";

/* Key pairs for integrity checking */
@@ -1086,9 +1086,9 @@ protected void incrementSeqNum() {
*/
final class DigestPrivacy extends DigestIntegrity implements SecurityCtx {
/* Used for generating privacy keys - specified in RFC 2831 */
static final private String CLIENT_CONF_MAGIC =
private static final String CLIENT_CONF_MAGIC =
"Digest H(A1) to client-to-server sealing key magic constant";
static final private String SVR_CONF_MAGIC =
private static final String SVR_CONF_MAGIC =
"Digest H(A1) to server-to-client sealing key magic constant";

private Cipher encCipher;
@@ -90,9 +90,9 @@ final class NTLMClient implements SaslClient {
"com.sun.security.sasl.ntlm.version";
private static final String NTLM_RANDOM =
"com.sun.security.sasl.ntlm.random";
private final static String NTLM_DOMAIN =
private static final String NTLM_DOMAIN =
"com.sun.security.sasl.ntlm.domain";
private final static String NTLM_HOSTNAME =
private static final String NTLM_HOSTNAME =
"com.sun.security.sasl.ntlm.hostname";

private final Client client;
@@ -83,11 +83,11 @@

final class NTLMServer implements SaslServer {

private final static String NTLM_VERSION =
private static final String NTLM_VERSION =
"com.sun.security.sasl.ntlm.version";
private final static String NTLM_DOMAIN =
private static final String NTLM_DOMAIN =
"com.sun.security.sasl.ntlm.domain";
private final static String NTLM_HOSTNAME =
private static final String NTLM_HOSTNAME =
"com.sun.security.sasl.ntlm.hostname";
private static final String NTLM_RANDOM =
"com.sun.security.sasl.ntlm.random";
@@ -34,17 +34,17 @@
*
* @author Rosanna Lee
*/
final public class PolicyUtils {
public final class PolicyUtils {
// Can't create one of these
private PolicyUtils() {
}

public final static int NOPLAINTEXT = 0x0001;
public final static int NOACTIVE = 0x0002;
public final static int NODICTIONARY = 0x0004;
public final static int FORWARD_SECRECY = 0x0008;
public final static int NOANONYMOUS = 0x0010;
public final static int PASS_CREDENTIALS = 0x0200;
public static final int NOPLAINTEXT = 0x0001;
public static final int NOACTIVE = 0x0002;
public static final int NODICTIONARY = 0x0004;
public static final int FORWARD_SECRECY = 0x0008;
public static final int NOANONYMOUS = 0x0010;
public static final int PASS_CREDENTIALS = 0x0200;

/**
* Determines whether a mechanism's characteristics, as defined in flags,
@@ -62,31 +62,31 @@ public interface CanonicalizationMethod extends Transform {
* The <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315">Canonical
* XML (without comments)</a> canonicalization method algorithm URI.
*/
final static String INCLUSIVE =
static final String INCLUSIVE =
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315";

/**
* The
* <a href="http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments">
* Canonical XML with comments</a> canonicalization method algorithm URI.
*/
final static String INCLUSIVE_WITH_COMMENTS =
static final String INCLUSIVE_WITH_COMMENTS =
"http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments";

/**
* The <a href="http://www.w3.org/2001/10/xml-exc-c14n#">Exclusive
* Canonical XML (without comments)</a> canonicalization method algorithm
* URI.
*/
final static String EXCLUSIVE =
static final String EXCLUSIVE =
"http://www.w3.org/2001/10/xml-exc-c14n#";

/**
* The <a href="http://www.w3.org/2001/10/xml-exc-c14n#WithComments">
* Exclusive Canonical XML with comments</a> canonicalization method
* algorithm URI.
*/
final static String EXCLUSIVE_WITH_COMMENTS =
static final String EXCLUSIVE_WITH_COMMENTS =
"http://www.w3.org/2001/10/xml-exc-c14n#WithComments";

/**
@@ -95,7 +95,7 @@ public interface CanonicalizationMethod extends Transform {
*
* @since 13
*/
final static String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";
static final String INCLUSIVE_11 = "http://www.w3.org/2006/12/xml-c14n11";

/**
* The <a href="https://www.w3.org/TR/xml-c14n11/#WithComments">
@@ -104,7 +104,7 @@ public interface CanonicalizationMethod extends Transform {
*
* @since 13
*/
final static String INCLUSIVE_11_WITH_COMMENTS =
static final String INCLUSIVE_11_WITH_COMMENTS =
"http://www.w3.org/2006/12/xml-c14n11#WithComments";

/**
@@ -69,7 +69,7 @@ public interface Manifest extends XMLStructure {
* specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#Manifest";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#Manifest";

/**
* Returns the Id of this <code>Manifest</code>.
@@ -68,7 +68,7 @@ public interface SignatureProperties extends XMLStructure {
* can be specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE =
static final String TYPE =
"http://www.w3.org/2000/09/xmldsig#SignatureProperties";

/**
@@ -69,32 +69,32 @@ public interface Transform extends XMLStructure, AlgorithmMethod {
* The <a href="http://www.w3.org/2000/09/xmldsig#base64">Base64</a>
* transform algorithm URI.
*/
final static String BASE64 = "http://www.w3.org/2000/09/xmldsig#base64";
static final String BASE64 = "http://www.w3.org/2000/09/xmldsig#base64";

/**
* The <a href="http://www.w3.org/2000/09/xmldsig#enveloped-signature">
* Enveloped Signature</a> transform algorithm URI.
*/
final static String ENVELOPED =
static final String ENVELOPED =
"http://www.w3.org/2000/09/xmldsig#enveloped-signature";

/**
* The <a href="http://www.w3.org/TR/1999/REC-xpath-19991116">XPath</a>
* transform algorithm URI.
*/
final static String XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116";
static final String XPATH = "http://www.w3.org/TR/1999/REC-xpath-19991116";

/**
* The <a href="http://www.w3.org/2002/06/xmldsig-filter2">
* XPath Filter 2</a> transform algorithm URI.
*/
final static String XPATH2 = "http://www.w3.org/2002/06/xmldsig-filter2";
static final String XPATH2 = "http://www.w3.org/2002/06/xmldsig-filter2";

/**
* The <a href="http://www.w3.org/TR/1999/REC-xslt-19991116">XSLT</a>
* transform algorithm URI.
*/
final static String XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116";
static final String XSLT = "http://www.w3.org/TR/1999/REC-xslt-19991116";

/**
* Returns the algorithm-specific input parameters associated with this
@@ -86,7 +86,7 @@ public interface XMLObject extends XMLStructure {
* specified as the value of the <code>type</code> parameter of the
* {@link Reference} class to identify the referent's type).
*/
final static String TYPE = "http://www.w3.org/2000/09/xmldsig#Object";
static final String TYPE = "http://www.w3.org/2000/09/xmldsig#Object";

/**
* Returns an {@link java.util.Collections#unmodifiableList unmodifiable

1 comment on commit ebbce91

@openjdk-notifier
Copy link

@openjdk-notifier openjdk-notifier bot commented on ebbce91 Apr 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.