aboutsummaryrefslogtreecommitdiff
path: root/src/java.security.jgss/share/classes/sun/security/krb5/internal
diff options
context:
space:
mode:
Diffstat (limited to 'src/java.security.jgss/share/classes/sun/security/krb5/internal')
-rw-r--r--src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java3
-rw-r--r--src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java20
-rw-r--r--src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java11
3 files changed, 26 insertions, 8 deletions
diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java
index 1f5f033c58b..2953a0f5782 100644
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/CredentialsUtil.java
@@ -455,8 +455,7 @@ public class CredentialsUtil {
Credentials newTgt = getTGTforRealm(tgtRealm, serviceRealm,
asCreds, okAsDelegate);
if (newTgt == null) {
- throw new KrbApErrException(Krb5.KRB_AP_ERR_GEN_CRED,
- "No service creds");
+ throw new KrbException("No service creds");
}
if (DEBUG) {
System.out.println(">>> Cross-realm TGT Credentials" +
diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java
index 93831f5a3e6..e2da0a3b1cd 100644
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2026, 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
@@ -71,6 +71,7 @@ public class Krb5 {
public static final int TKT_OPTS_INITIAL = 9;
public static final int TKT_OPTS_PRE_AUTHENT = 10;
public static final int TKT_OPTS_HW_AUTHENT = 11;
+ public static final int TKT_OPTS_TRANSIT_POLICY_CHECKED = 12;
public static final int TKT_OPTS_DELEGATE = 13;
public static final int TKT_OPTS_ENC_PA_REP = 15;
public static final int TKT_OPTS_MAX = 31;
@@ -250,6 +251,9 @@ public class Krb5 {
public static final int KDC_ERR_KEY_EXPIRED = 23; //Password has expired - change password to reset
public static final int KDC_ERR_PREAUTH_FAILED = 24; //Pre-authentication information was invalid
public static final int KDC_ERR_PREAUTH_REQUIRED = 25; //Additional pre-authentication required
+ public static final int KDC_ERR_SERVER_NOMATCH = 26; //Requested server and ticket don't match
+ public static final int KDC_ERR_MUST_USE_USER2USER = 27; //Server principal valid for user2user only
+ public static final int KDC_ERR_PATH_NOT_ACCEPTED = 28; //KDC Policy rejects transited path
public static final int KDC_ERR_SVC_UNAVAILABLE = 29; //A service is not available
public static final int KRB_AP_ERR_BAD_INTEGRITY = 31; //Integrity check on decrypted field failed
public static final int KRB_AP_ERR_TKT_EXPIRED = 32; //Ticket expired
@@ -270,13 +274,13 @@ public class Krb5 {
public static final int KRB_AP_ERR_METHOD = 48; //Alternative authentication method required
public static final int KRB_AP_ERR_BADSEQ = 49; //Incorrect sequence number in message
public static final int KRB_AP_ERR_INAPP_CKSUM = 50; //Inappropriate type of checksum in message
+ public static final int KRB_AP_PATH_NOT_ACCEPTED = 51; //Policy rejects transited path
public static final int KRB_ERR_RESPONSE_TOO_BIG = 52; //Response too big for UDP, retry with TCP
public static final int KRB_ERR_GENERIC = 60; //Generic error (description in e-text)
public static final int KRB_ERR_FIELD_TOOLONG = 61; //Field is too long for this implementation
public static final int KRB_ERR_WRONG_REALM = 68; //Wrong realm
- public static final int KRB_CRYPTO_NOT_SUPPORT = 100; //Client does not support this crypto type
- public static final int KRB_AP_ERR_NOREALM = 62;
- public static final int KRB_AP_ERR_GEN_CRED = 63;
+
+ public static final int KRB_CRYPTO_NOT_SUPPORT = 100; //Client does not support this crypto type
// public static final int KRB_AP_ERR_CKSUM_NOKEY =101; //Lack of the key to generate the checksum
// error codes specific to this implementation
public static final int KRB_AP_ERR_REQ_OPTIONS = 101; //Invalid TGS_REQ
@@ -343,6 +347,10 @@ public class Krb5 {
errMsgList.put(KDC_ERR_KEY_EXPIRED, "Password has expired - change password to reset");
errMsgList.put(KDC_ERR_PREAUTH_FAILED, "Pre-authentication information was invalid");
errMsgList.put(KDC_ERR_PREAUTH_REQUIRED, "Additional pre-authentication required");
+ errMsgList.put(KDC_ERR_SERVER_NOMATCH, "Requested server and ticket don't match");
+ errMsgList.put(KDC_ERR_MUST_USE_USER2USER, "Server principal valid for user2user only");
+ errMsgList.put(KDC_ERR_PATH_NOT_ACCEPTED, "KDC Policy rejects transited path");
+ errMsgList.put(KDC_ERR_SVC_UNAVAILABLE, "A service is not available");
errMsgList.put(KRB_AP_ERR_BAD_INTEGRITY, "Integrity check on decrypted field failed");
errMsgList.put(KRB_AP_ERR_TKT_EXPIRED, "Ticket expired");
errMsgList.put(KRB_AP_ERR_TKT_NYV, "Ticket not yet valid");
@@ -362,10 +370,11 @@ public class Krb5 {
errMsgList.put(KRB_AP_ERR_METHOD, "Alternative authentication method required");
errMsgList.put(KRB_AP_ERR_BADSEQ, "Incorrect sequence number in message");
errMsgList.put(KRB_AP_ERR_INAPP_CKSUM, "Inappropriate type of checksum in message");
+ errMsgList.put(KRB_AP_PATH_NOT_ACCEPTED, "Policy rejects transited path");
errMsgList.put(KRB_ERR_RESPONSE_TOO_BIG, "Response too big for UDP, retry with TCP");
errMsgList.put(KRB_ERR_GENERIC, "Generic error (description in e-text)");
errMsgList.put(KRB_ERR_FIELD_TOOLONG, "Field is too long for this implementation");
- errMsgList.put(KRB_AP_ERR_NOREALM, "Realm name not available"); //used in setDefaultCreds() in sun.security.krb5.Credentials
+ errMsgList.put(KRB_ERR_WRONG_REALM, "Wrong realm");
// error messages specific to this implementation
@@ -395,7 +404,6 @@ public class Krb5 {
errMsgList.put(ASN1_CANNOT_ENCODE, "Encoding failed due to invalid parameter(s)");
errMsgList.put(KRB_CRYPTO_NOT_SUPPORT, "Client has no support for crypto type");
errMsgList.put(KRB_AP_ERR_REQ_OPTIONS, "Invalid option setting in ticket request.");
- errMsgList.put(KRB_AP_ERR_GEN_CRED, "Fail to create credential.");
}
}
diff --git a/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java b/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java
index cc1951f370c..294a4e69c9d 100644
--- a/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java
+++ b/src/java.security.jgss/share/classes/sun/security/krb5/internal/TicketFlags.java
@@ -52,6 +52,8 @@ import java.io.IOException;
* initial(9),
* pre-authent(10),
* hw-authent(11),
+ * transited-policy-checked(12),
+ * ok-as-delegate(13)
* enc-pa-rep(15)
* }
*/
@@ -180,9 +182,18 @@ public class TicketFlags extends KerberosFlags {
case 11:
sb.append("HW-AUTHENT;");
break;
+ case 12:
+ sb.append("TRANSIT-POLICY-CHECKED;");
+ break;
+ case 13:
+ sb.append("OK-AS-DELEGATE;");
+ break;
case 15:
sb.append("ENC-PA-REP;");
break;
+ default:
+ sb.append(i).append(";");
+ break;
}
}
}