src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 57487 643978a35f6e
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
     2
 * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *  (C) Copyright IBM Corp. 1999 All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
package sun.security.krb5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import sun.security.krb5.internal.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import sun.security.krb5.internal.crypto.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.net.UnknownHostException;
47005
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
    38
import java.time.Instant;
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    39
import java.util.Arrays;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * This class encapsulates a Kerberos TGS-REQ that is sent from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * client to the KDC.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    45
public class KrbTgsReq {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private PrincipalName princName;
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    48
    private PrincipalName clientAlias;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private PrincipalName servName;
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    50
    private PrincipalName serverAlias;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    private TGSReq tgsReqMessg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    private KerberosTime ctime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    private Ticket secondTicket = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    private boolean useSubkey = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    EncryptionKey tgsReqKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    private static final boolean DEBUG = Krb5.DEBUG;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    59
    private byte[] obuf;
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    60
    private byte[] ibuf;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    62
    // Used in CredentialsUtil
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    63
    public KrbTgsReq(KDCOptions options, Credentials asCreds,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    64
            PrincipalName cname, PrincipalName clientAlias,
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    65
            PrincipalName sname, PrincipalName serverAlias,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    66
            Ticket[] additionalTickets, PAData[] extraPAs)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        throws KrbException, IOException {
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    68
        this(options,
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    69
             asCreds,
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    70
             cname,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    71
             clientAlias,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    72
             sname,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    73
             serverAlias,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    74
             null, // KerberosTime from
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    75
             null, // KerberosTime till
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    76
             null, // KerberosTime rtime
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    77
             null, // int[] eTypes
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    78
             null, // HostAddresses addresses
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    79
             null, // AuthorizationData authorizationData
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    80
             additionalTickets,
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    81
             null, // EncryptionKey subKey
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
    82
             extraPAs);
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    83
    }
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    84
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    85
    // Called by Credentials, KrbCred
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    86
    KrbTgsReq(
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    87
            KDCOptions options,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    88
            Credentials asCreds,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    89
            PrincipalName sname,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    90
            PrincipalName serverAlias,
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    91
            KerberosTime from,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    92
            KerberosTime till,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    93
            KerberosTime rtime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    94
            int[] eTypes,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    95
            HostAddresses addresses,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    96
            AuthorizationData authorizationData,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    97
            Ticket[] additionalTickets,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
    98
            EncryptionKey subKey) throws KrbException, IOException {
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
    99
        this(options, asCreds, asCreds.getClient(), asCreds.getClientAlias(),
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   100
                sname, serverAlias, from, till, rtime, eTypes,
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   101
                addresses, authorizationData, additionalTickets, subKey, null);
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   102
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   104
    private KrbTgsReq(
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   105
            KDCOptions options,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   106
            Credentials asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   107
            PrincipalName cname,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   108
            PrincipalName clientAlias,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   109
            PrincipalName sname,
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   110
            PrincipalName serverAlias,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   111
            KerberosTime from,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   112
            KerberosTime till,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   113
            KerberosTime rtime,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   114
            int[] eTypes,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   115
            HostAddresses addresses,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   116
            AuthorizationData authorizationData,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   117
            Ticket[] additionalTickets,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   118
            EncryptionKey subKey,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   119
            PAData[] extraPAs) throws KrbException, IOException {
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   120
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   121
        princName = cname;
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   122
        this.clientAlias = clientAlias;
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   123
        servName = sname;
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   124
        this.serverAlias = serverAlias;
16905
0419f45c7761 8011124: Make KerberosTime immutable
weijun
parents: 14413
diff changeset
   125
        ctime = KerberosTime.now();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   127
        // check if they are valid arguments. The optional fields
28670
bb9afe681988 8022582: Relax response flags checking in sun.security.krb5.KrbKdcRep.check.
weijun
parents: 27946
diff changeset
   128
        // should be consistent with settings in KDCOptions.
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   129
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   130
        if (options.get(KDCOptions.FORWARDABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   131
                (!(asCreds.flags.get(Krb5.TKT_OPTS_FORWARDABLE)))) {
28670
bb9afe681988 8022582: Relax response flags checking in sun.security.krb5.KrbKdcRep.check.
weijun
parents: 27946
diff changeset
   132
            options.set(KDCOptions.FORWARDABLE, false);
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   133
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   134
        if (options.get(KDCOptions.FORWARDED)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   135
            if (!(asCreds.flags.get(KDCOptions.FORWARDABLE)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   136
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   137
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   138
        if (options.get(KDCOptions.PROXIABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   139
                (!(asCreds.flags.get(Krb5.TKT_OPTS_PROXIABLE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   140
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   141
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   142
        if (options.get(KDCOptions.PROXY)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   143
            if (!(asCreds.flags.get(KDCOptions.PROXIABLE)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   144
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   145
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   146
        if (options.get(KDCOptions.ALLOW_POSTDATE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   147
                (!(asCreds.flags.get(Krb5.TKT_OPTS_MAY_POSTDATE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   148
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   149
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   150
        if (options.get(KDCOptions.RENEWABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   151
                (!(asCreds.flags.get(Krb5.TKT_OPTS_RENEWABLE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   152
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   153
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   155
        if (options.get(KDCOptions.POSTDATED)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   156
            if (!(asCreds.flags.get(KDCOptions.POSTDATED)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   157
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   158
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   159
            if (from != null)  from = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   160
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   161
        if (options.get(KDCOptions.RENEWABLE)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   162
            if (!(asCreds.flags.get(KDCOptions.RENEWABLE)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   163
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   164
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   165
            if (rtime != null)  rtime = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   166
        }
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   167
        if (options.get(KDCOptions.ENC_TKT_IN_SKEY) || options.get(KDCOptions.CNAME_IN_ADDL_TKT)) {
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   168
            if (additionalTickets == null)
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   169
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   170
            // in TGS_REQ there could be more than one additional
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   171
            // tickets,  but in file-based credential cache,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   172
            // there is only one additional ticket field.
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   173
            secondTicket = additionalTickets[0];
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   174
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   175
            if (additionalTickets != null)
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   176
                additionalTickets = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   177
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   179
        tgsReqMessg = createRequest(
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   180
                options,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   181
                asCreds.ticket,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   182
                asCreds.key,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   183
                ctime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   184
                princName,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   185
                servName,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   186
                from,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   187
                till,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   188
                rtime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   189
                eTypes,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   190
                addresses,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   191
                authorizationData,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   192
                additionalTickets,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   193
                subKey,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   194
                extraPAs);
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   195
        obuf = tgsReqMessg.asn1Encode();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   197
        // XXX We need to revisit this to see if can't move it
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   198
        // up such that FORWARDED flag set in the options
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   199
        // is included in the marshaled request.
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   200
        /*
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   201
         * If this is based on a forwarded ticket, record that in the
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   202
         * options, because the returned TgsRep will contain the
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   203
         * FORWARDED flag set.
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   204
         */
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   205
        if (asCreds.flags.get(KDCOptions.FORWARDED))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   206
            options.set(KDCOptions.FORWARDED, true);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   209
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * Sends a TGS request to the realm of the target.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * @throws KrbException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * @throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     */
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   216
    public void send() throws IOException, KrbException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        String realmStr = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        if (servName != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
            realmStr = servName.getRealmString();
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   220
        KdcComm comm = new KdcComm(realmStr);
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   221
        ibuf = comm.send(obuf);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public KrbTgsRep getReply()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        throws KrbException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
        return new KrbTgsRep(ibuf, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Sends the request, waits for a reply, and returns the Credentials.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     * Used in Credentials, KrbCred, and internal/CredentialsUtil.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public Credentials sendAndGetCreds() throws IOException, KrbException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        KrbTgsRep tgs_rep = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        String kdc = null;
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   236
        send();
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   237
        tgs_rep = getReply();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        return tgs_rep.getCreds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    KerberosTime getCtime() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        return ctime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    private TGSReq createRequest(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
                         KDCOptions kdc_options,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
                         Ticket ticket,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
                         EncryptionKey key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
                         KerberosTime ctime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
                         PrincipalName cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
                         PrincipalName sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
                         KerberosTime from,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                         KerberosTime till,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
                         KerberosTime rtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
                         int[] eTypes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
                         HostAddresses addresses,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
                         AuthorizationData authorizationData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
                         Ticket[] additionalTickets,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   259
                         EncryptionKey subKey,
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   260
                         PAData[] extraPAs)
18168
f47169155ea0 8014310: JAAS/Krb5LoginModule using des encytypes failure with NPE after JDK-8012679
weijun
parents: 16905
diff changeset
   261
        throws IOException, KrbException, UnknownHostException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        KerberosTime req_till = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        if (till == null) {
47005
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   264
            String d = Config.getInstance().get("libdefaults", "ticket_lifetime");
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   265
            if (d != null) {
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   266
                req_till = new KerberosTime(Instant.now().plusSeconds(Config.duration(d)));
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   267
            } else {
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   268
                req_till = new KerberosTime(0); // Choose KDC maximum allowed
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   269
            }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
            req_till = till;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
         * RFC 4120, Section 5.4.2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
         * For KRB_TGS_REP, the ciphertext is encrypted in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
         * sub-session key from the Authenticator, or if absent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
         * the session key from the ticket-granting ticket used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
         * in the request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
         * To support this, use tgsReqKey to remember which key to use.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        tgsReqKey = key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        int[] req_eTypes = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        if (eTypes == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
            req_eTypes = EType.getDefaults("default_tgs_enctypes");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
            req_eTypes = eTypes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        EncryptionKey reqKey = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        EncryptedData encAuthorizationData = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        if (authorizationData != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
            byte[] ad = authorizationData.asn1Encode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            if (subKey != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                reqKey = subKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
                tgsReqKey = subKey;    // Key to use to decrypt reply
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                useSubkey = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                encAuthorizationData = new EncryptedData(reqKey, ad,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                    KeyUsage.KU_TGS_REQ_AUTH_DATA_SUBKEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
            } else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
                encAuthorizationData = new EncryptedData(key, ad,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
                    KeyUsage.KU_TGS_REQ_AUTH_DATA_SESSKEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        KDCReqBody reqBody = new KDCReqBody(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
                                            kdc_options,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
                                            cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
                                            sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
                                            from,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                                            req_till,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
                                            rtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                                            Nonce.value(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
                                            req_eTypes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
                                            addresses,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                                            encAuthorizationData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                                            additionalTickets);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        byte[] temp = reqBody.asn1Encode(Krb5.KRB_TGS_REQ);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        // if the checksum type is one of the keyed checksum types,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        // use session key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        Checksum cksum;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
        switch (Checksum.CKSUMTYPE_DEFAULT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        case Checksum.CKSUMTYPE_RSA_MD4_DES:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        case Checksum.CKSUMTYPE_DES_MAC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        case Checksum.CKSUMTYPE_DES_MAC_K:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        case Checksum.CKSUMTYPE_RSA_MD4_DES_K:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
        case Checksum.CKSUMTYPE_RSA_MD5_DES:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        case Checksum.CKSUMTYPE_HMAC_SHA1_DES3_KD:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        case Checksum.CKSUMTYPE_HMAC_MD5_ARCFOUR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES128:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
        case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES256:
48651
67abfee27e69 8014628: Support AES Encryption with HMAC-SHA2 for Kerberos 5
weijun
parents: 47216
diff changeset
   334
        case Checksum.CKSUMTYPE_HMAC_SHA256_128_AES128:
67abfee27e69 8014628: Support AES Encryption with HMAC-SHA2 for Kerberos 5
weijun
parents: 47216
diff changeset
   335
        case Checksum.CKSUMTYPE_HMAC_SHA384_192_AES256:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
            cksum = new Checksum(Checksum.CKSUMTYPE_DEFAULT, temp, key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                KeyUsage.KU_PA_TGS_REQ_CKSUM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        case Checksum.CKSUMTYPE_CRC32:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        case Checksum.CKSUMTYPE_RSA_MD4:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        case Checksum.CKSUMTYPE_RSA_MD5:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
            cksum = new Checksum(Checksum.CKSUMTYPE_DEFAULT, temp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        // Usage will be KeyUsage.KU_PA_TGS_REQ_AUTHENTICATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        byte[] tgs_ap_req = new KrbApReq(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                                         new APOptions(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                                         ticket,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
                                         key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
                                         cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                                         cksum,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
                                         ctime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
                                         reqKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
                                         null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
                                         null).getMessage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   359
        PAData tgsPAData = new PAData(Krb5.PA_TGS_REQ, tgs_ap_req);
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   360
        PAData[] pa;
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   361
        if (extraPAs != null) {
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   362
            pa = Arrays.copyOf(extraPAs, extraPAs.length + 1);
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   363
            pa[extraPAs.length] = tgsPAData;
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   364
        } else {
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   365
            pa = new PAData[] {tgsPAData};
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   366
        }
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 48651
diff changeset
   367
        return new TGSReq(pa, reqBody);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    TGSReq getMessage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        return tgsReqMessg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
    Ticket getSecondTicket() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        return secondTicket;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
57487
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   378
    PrincipalName getClientAlias() {
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   379
        return clientAlias;
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   380
    }
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   381
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   382
    PrincipalName getServerAlias() {
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   383
        return serverAlias;
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   384
    }
643978a35f6e 8227437: S4U2proxy cannot continue because server's TGT cannot be found
mbalao
parents: 55258
diff changeset
   385
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    private static void debug(String message) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        //      System.err.println(">>> KrbTgsReq: " + message);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    boolean usedSubkey() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        return useSubkey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
}