src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java
author erikj
Tue, 12 Sep 2017 19:03:39 +0200
changeset 47216 71c04702a3d5
parent 47005 jdk/src/java.security.jgss/share/classes/sun/security/krb5/KrbTgsReq.java@dbfaf076da58
child 48651 67abfee27e69
permissions -rw-r--r--
8187443: Forest Consolidation: Move files to unified layout Reviewed-by: darcy, ihse
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
47005
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
     2
 * Copyright (c) 2000, 2017, 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;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * This class encapsulates a Kerberos TGS-REQ that is sent from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * client to the KDC.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    44
public class KrbTgsReq {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    private PrincipalName princName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private PrincipalName servName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private TGSReq tgsReqMessg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private KerberosTime ctime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    private Ticket secondTicket = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    private boolean useSubkey = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    EncryptionKey tgsReqKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
    private static final boolean DEBUG = Krb5.DEBUG;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    56
    private byte[] obuf;
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
    57
    private byte[] ibuf;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    59
    // Used in CredentialsUtil
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public KrbTgsReq(Credentials asCreds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
                     PrincipalName sname)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
        throws KrbException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
        this(new KDCOptions(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            asCreds,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
            sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
            null, // KerberosTime from
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
            null, // KerberosTime till
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
            null, // KerberosTime rtime
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
            null, // eTypes, // null, // int[] eTypes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
            null, // HostAddresses addresses
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
            null, // AuthorizationData authorizationData
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
            null, // Ticket[] additionalTickets
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            null); // EncryptionKey subSessionKey
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    76
    // S4U2proxy
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    77
    public KrbTgsReq(Credentials asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    78
                     Ticket second,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    79
                     PrincipalName sname)
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    80
            throws KrbException, IOException {
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    81
        this(KDCOptions.with(KDCOptions.CNAME_IN_ADDL_TKT,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    82
                KDCOptions.FORWARDABLE),
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    83
            asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    84
            sname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    85
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    86
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    87
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    88
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    89
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    90
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    91
            new Ticket[] {second}, // the service ticket
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    92
            null);
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    93
    }
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    94
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    95
    // S4U2user
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    96
    public KrbTgsReq(Credentials asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    97
                     PrincipalName sname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    98
                     PAData extraPA)
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
    99
        throws KrbException, IOException {
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   100
        this(KDCOptions.with(KDCOptions.FORWARDABLE),
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   101
            asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   102
            asCreds.getClient(),
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   103
            sname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   104
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   105
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   106
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   107
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   108
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   109
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   110
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   111
            null,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   112
            extraPA); // the PA-FOR-USER
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   113
    }
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   114
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   115
    // Called by Credentials, KrbCred
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   116
    KrbTgsReq(
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   117
            KDCOptions options,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   118
            Credentials asCreds,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   119
            PrincipalName sname,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   120
            KerberosTime from,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   121
            KerberosTime till,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   122
            KerberosTime rtime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   123
            int[] eTypes,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   124
            HostAddresses addresses,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   125
            AuthorizationData authorizationData,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   126
            Ticket[] additionalTickets,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   127
            EncryptionKey subKey) throws KrbException, IOException {
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   128
        this(options, asCreds, asCreds.getClient(), sname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   129
                from, till, rtime, eTypes, addresses,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   130
                authorizationData, additionalTickets, subKey, null);
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   131
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   133
    private KrbTgsReq(
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   134
            KDCOptions options,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   135
            Credentials asCreds,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   136
            PrincipalName cname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   137
            PrincipalName sname,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   138
            KerberosTime from,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   139
            KerberosTime till,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   140
            KerberosTime rtime,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   141
            int[] eTypes,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   142
            HostAddresses addresses,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   143
            AuthorizationData authorizationData,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   144
            Ticket[] additionalTickets,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   145
            EncryptionKey subKey,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   146
            PAData extraPA) throws KrbException, IOException {
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   147
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   148
        princName = cname;
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   149
        servName = sname;
16905
0419f45c7761 8011124: Make KerberosTime immutable
weijun
parents: 14413
diff changeset
   150
        ctime = KerberosTime.now();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   152
        // 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
   153
        // should be consistent with settings in KDCOptions.
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   154
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   155
        if (options.get(KDCOptions.FORWARDABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   156
                (!(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
   157
            options.set(KDCOptions.FORWARDABLE, false);
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   158
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   159
        if (options.get(KDCOptions.FORWARDED)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   160
            if (!(asCreds.flags.get(KDCOptions.FORWARDABLE)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   161
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   162
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   163
        if (options.get(KDCOptions.PROXIABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   164
                (!(asCreds.flags.get(Krb5.TKT_OPTS_PROXIABLE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   165
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   166
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   167
        if (options.get(KDCOptions.PROXY)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   168
            if (!(asCreds.flags.get(KDCOptions.PROXIABLE)))
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
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   171
        if (options.get(KDCOptions.ALLOW_POSTDATE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   172
                (!(asCreds.flags.get(Krb5.TKT_OPTS_MAY_POSTDATE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   173
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   174
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   175
        if (options.get(KDCOptions.RENEWABLE) &&
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   176
                (!(asCreds.flags.get(Krb5.TKT_OPTS_RENEWABLE)))) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   177
            throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   178
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   180
        if (options.get(KDCOptions.POSTDATED)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   181
            if (!(asCreds.flags.get(KDCOptions.POSTDATED)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   182
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   183
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   184
            if (from != null)  from = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   185
        }
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   186
        if (options.get(KDCOptions.RENEWABLE)) {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   187
            if (!(asCreds.flags.get(KDCOptions.RENEWABLE)))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   188
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   189
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   190
            if (rtime != null)  rtime = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   191
        }
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   192
        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
   193
            if (additionalTickets == null)
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   194
                throw new KrbException(Krb5.KRB_AP_ERR_REQ_OPTIONS);
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   195
            // in TGS_REQ there could be more than one additional
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   196
            // tickets,  but in file-based credential cache,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   197
            // there is only one additional ticket field.
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   198
            secondTicket = additionalTickets[0];
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   199
        } else {
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   200
            if (additionalTickets != null)
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   201
                additionalTickets = null;
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   202
        }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   204
        tgsReqMessg = createRequest(
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   205
                options,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   206
                asCreds.ticket,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   207
                asCreds.key,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   208
                ctime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   209
                princName,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   210
                servName,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   211
                from,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   212
                till,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   213
                rtime,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   214
                eTypes,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   215
                addresses,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   216
                authorizationData,
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   217
                additionalTickets,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   218
                subKey,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   219
                extraPA);
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   220
        obuf = tgsReqMessg.asn1Encode();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   222
        // 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
   223
        // up such that FORWARDED flag set in the options
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   224
        // is included in the marshaled request.
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   225
        /*
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   226
         * If this is based on a forwarded ticket, record that in the
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   227
         * options, because the returned TgsRep will contain the
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   228
         * FORWARDED flag set.
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   229
         */
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   230
        if (asCreds.flags.get(KDCOptions.FORWARDED))
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   231
            options.set(KDCOptions.FORWARDED, true);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   234
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     * Sends a TGS request to the realm of the target.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @throws KrbException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     * @throws IOException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
     */
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   241
    public void send() throws IOException, KrbException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        String realmStr = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        if (servName != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            realmStr = servName.getRealmString();
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   245
        KdcComm comm = new KdcComm(realmStr);
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   246
        ibuf = comm.send(obuf);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public KrbTgsRep getReply()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
        throws KrbException, IOException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        return new KrbTgsRep(ibuf, this);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * Sends the request, waits for a reply, and returns the Credentials.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * Used in Credentials, KrbCred, and internal/CredentialsUtil.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    public Credentials sendAndGetCreds() throws IOException, KrbException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
        KrbTgsRep tgs_rep = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
        String kdc = null;
7183
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   261
        send();
d8ccc1c73358 6960894: Better AS-REQ creation and processing
weijun
parents: 5506
diff changeset
   262
        tgs_rep = getReply();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
        return tgs_rep.getCreds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    KerberosTime getCtime() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        return ctime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    private TGSReq createRequest(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
                         KDCOptions kdc_options,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
                         Ticket ticket,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
                         EncryptionKey key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
                         KerberosTime ctime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
                         PrincipalName cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                         PrincipalName sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                         KerberosTime from,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                         KerberosTime till,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                         KerberosTime rtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                         int[] eTypes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                         HostAddresses addresses,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
                         AuthorizationData authorizationData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
                         Ticket[] additionalTickets,
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   284
                         EncryptionKey subKey,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   285
                         PAData extraPA)
18168
f47169155ea0 8014310: JAAS/Krb5LoginModule using des encytypes failure with NPE after JDK-8012679
weijun
parents: 16905
diff changeset
   286
        throws IOException, KrbException, UnknownHostException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        KerberosTime req_till = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        if (till == null) {
47005
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   289
            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
   290
            if (d != null) {
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   291
                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
   292
            } else {
dbfaf076da58 8186576: KerberosTicket does not properly handle renewable tickets at the end of their lifetime
weijun
parents: 28670
diff changeset
   293
                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
   294
            }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            req_till = till;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
         * RFC 4120, Section 5.4.2.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
         * For KRB_TGS_REP, the ciphertext is encrypted in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
         * sub-session key from the Authenticator, or if absent,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
         * the session key from the ticket-granting ticket used
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
         * in the request.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
         *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
         * To support this, use tgsReqKey to remember which key to use.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        tgsReqKey = key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        int[] req_eTypes = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
        if (eTypes == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
            req_eTypes = EType.getDefaults("default_tgs_enctypes");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
            req_eTypes = eTypes;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
        EncryptionKey reqKey = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
        EncryptedData encAuthorizationData = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
        if (authorizationData != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
            byte[] ad = authorizationData.asn1Encode();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
            if (subKey != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                reqKey = subKey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                tgsReqKey = subKey;    // Key to use to decrypt reply
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
                useSubkey = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
                encAuthorizationData = new EncryptedData(reqKey, ad,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
                    KeyUsage.KU_TGS_REQ_AUTH_DATA_SUBKEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
            } else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
                encAuthorizationData = new EncryptedData(key, ad,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
                    KeyUsage.KU_TGS_REQ_AUTH_DATA_SESSKEY);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        KDCReqBody reqBody = new KDCReqBody(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
                                            kdc_options,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
                                            cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
                                            sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
                                            from,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
                                            req_till,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
                                            rtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
                                            Nonce.value(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
                                            req_eTypes,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
                                            addresses,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
                                            encAuthorizationData,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
                                            additionalTickets);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        byte[] temp = reqBody.asn1Encode(Krb5.KRB_TGS_REQ);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        // if the checksum type is one of the keyed checksum types,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        // use session key.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        Checksum cksum;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        switch (Checksum.CKSUMTYPE_DEFAULT) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        case Checksum.CKSUMTYPE_RSA_MD4_DES:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        case Checksum.CKSUMTYPE_DES_MAC:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        case Checksum.CKSUMTYPE_DES_MAC_K:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        case Checksum.CKSUMTYPE_RSA_MD4_DES_K:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
        case Checksum.CKSUMTYPE_RSA_MD5_DES:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        case Checksum.CKSUMTYPE_HMAC_SHA1_DES3_KD:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        case Checksum.CKSUMTYPE_HMAC_MD5_ARCFOUR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES128:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        case Checksum.CKSUMTYPE_HMAC_SHA1_96_AES256:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            cksum = new Checksum(Checksum.CKSUMTYPE_DEFAULT, temp, key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
                KeyUsage.KU_PA_TGS_REQ_CKSUM);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        case Checksum.CKSUMTYPE_CRC32:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        case Checksum.CKSUMTYPE_RSA_MD4:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        case Checksum.CKSUMTYPE_RSA_MD5:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
            cksum = new Checksum(Checksum.CKSUMTYPE_DEFAULT, temp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        // Usage will be KeyUsage.KU_PA_TGS_REQ_AUTHENTICATOR
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        byte[] tgs_ap_req = new KrbApReq(
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
                                         new APOptions(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
                                         ticket,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
                                         key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                                         cname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
                                         cksum,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                                         ctime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
                                         reqKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
                                         null,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
                                         null).getMessage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   382
        PAData tgsPAData = new PAData(Krb5.PA_TGS_REQ, tgs_ap_req);
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   383
        return new TGSReq(
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   384
                extraPA != null ?
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   385
                    new PAData[] {extraPA, tgsPAData } :
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   386
                    new PAData[] {tgsPAData},
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 14342
diff changeset
   387
                reqBody);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    TGSReq getMessage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        return tgsReqMessg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    Ticket getSecondTicket() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
        return secondTicket;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
    private static void debug(String message) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        //      System.err.println(">>> KrbTgsReq: " + message);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
    boolean usedSubkey() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
        return useSubkey;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
}