mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8215032: Support Kerberos cross-realm referrals (RFC 6806)
Reviewed-by: weijun
This commit is contained in:
parent
8ee8c48696
commit
5aae9ef0db
25 changed files with 933 additions and 204 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2000, 2019, 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
|
||||
|
@ -48,6 +48,7 @@ import sun.net.dns.ResolverConfiguration;
|
|||
import sun.security.action.GetPropertyAction;
|
||||
import sun.security.krb5.internal.crypto.EType;
|
||||
import sun.security.krb5.internal.Krb5;
|
||||
import sun.security.util.SecurityProperties;
|
||||
|
||||
/**
|
||||
* This class maintains key-value pairs of Kerberos configurable constants
|
||||
|
@ -56,6 +57,41 @@ import sun.security.krb5.internal.Krb5;
|
|||
|
||||
public class Config {
|
||||
|
||||
/**
|
||||
* {@systemProperty sun.security.krb5.disableReferrals} property
|
||||
* indicating whether or not cross-realm referrals (RFC 6806) are
|
||||
* enabled.
|
||||
*/
|
||||
public static final boolean DISABLE_REFERRALS;
|
||||
|
||||
/**
|
||||
* {@systemProperty sun.security.krb5.maxReferrals} property
|
||||
* indicating the maximum number of cross-realm referral
|
||||
* hops allowed.
|
||||
*/
|
||||
public static final int MAX_REFERRALS;
|
||||
|
||||
static {
|
||||
String disableReferralsProp =
|
||||
SecurityProperties.privilegedGetOverridable(
|
||||
"sun.security.krb5.disableReferrals");
|
||||
if (disableReferralsProp != null) {
|
||||
DISABLE_REFERRALS = "true".equalsIgnoreCase(disableReferralsProp);
|
||||
} else {
|
||||
DISABLE_REFERRALS = false;
|
||||
}
|
||||
|
||||
int maxReferralsValue = 5;
|
||||
String maxReferralsProp =
|
||||
SecurityProperties.privilegedGetOverridable(
|
||||
"sun.security.krb5.maxReferrals");
|
||||
try {
|
||||
maxReferralsValue = Integer.parseInt(maxReferralsProp);
|
||||
} catch (NumberFormatException e) {
|
||||
}
|
||||
MAX_REFERRALS = maxReferralsValue;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only allow a single instance of Config.
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue