src/java.security.jgss/share/classes/sun/security/krb5/internal/Krb5.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 58331 e4ce29f6094e
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: 51398
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: 2
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: 2
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: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
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.internal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
51398
3c389a284345 8209416: Refactoring GetPropertyAction calls in security libs
weijun
parents: 47216
diff changeset
    34
import sun.security.action.GetBooleanAction;
3c389a284345 8209416: Refactoring GetPropertyAction calls in security libs
weijun
parents: 47216
diff changeset
    35
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.util.Hashtable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
// Constants and other defined values from RFC 4120
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
public class Krb5 {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
    //Recommended KDC values
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    public static final int DEFAULT_ALLOWABLE_CLOCKSKEW = 5 * 60; //5 minutes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
    public static final int DEFAULT_MINIMUM_LIFETIME = 5 * 60; //5 minutes
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    public static final int DEFAULT_MAXIMUM_RENEWABLE_LIFETIME = 7 * 24 * 60 * 60; //1 week
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    public static final int DEFAULT_MAXIMUM_TICKET_LIFETIME = 24 * 60 * 60; //1 day
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    public static final boolean DEFAULT_FORWARDABLE_ALLOWED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    public static final boolean DEFAULT_PROXIABLE_ALLOWED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    public static final boolean DEFAULT_POSTDATE_ALLOWED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    public static final boolean DEFAULT_RENEWABLE_ALLOWED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static final boolean AP_EMPTY_ADDRESSES_ALLOWED = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    //AP_REQ Options
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    public static final int AP_OPTS_RESERVED        = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    public static final int AP_OPTS_USE_SESSION_KEY = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    public static final int AP_OPTS_MUTUAL_REQUIRED = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    public static final int AP_OPTS_MAX             = 31;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    //Ticket Flags
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public static final int TKT_OPTS_RESERVED     = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    public static final int TKT_OPTS_FORWARDABLE  = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    public static final int TKT_OPTS_FORWARDED    = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    public static final int TKT_OPTS_PROXIABLE    = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public static final int TKT_OPTS_PROXY        = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public static final int TKT_OPTS_MAY_POSTDATE = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    public static final int TKT_OPTS_POSTDATED    = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    public static final int TKT_OPTS_INVALID      = 7;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public static final int TKT_OPTS_RENEWABLE    = 8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    public static final int TKT_OPTS_INITIAL      = 9;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public static final int TKT_OPTS_PRE_AUTHENT  = 10;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public static final int TKT_OPTS_HW_AUTHENT   = 11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    public static final int TKT_OPTS_DELEGATE     = 13;
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 51398
diff changeset
    75
    public static final int TKT_OPTS_ENC_PA_REP   = 15;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    public static final int TKT_OPTS_MAX          = 31;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    // KDC Options
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    // (option values defined in KDCOptions.java)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public static final int KDC_OPTS_MAX          = 31;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    // KerberosFlags
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    public static final int KRB_FLAGS_MAX         = 31;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
    //Last Request types
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    public static final int LRTYPE_NONE                 = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public static final int LRTYPE_TIME_OF_INITIAL_TGT  = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    public static final int LRTYPE_TIME_OF_INITIAL_REQ  = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    public static final int LRTYPE_TIME_OF_NEWEST_TGT   = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
    public static final int LRTYPE_TIME_OF_LAST_RENEWAL = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    public static final int LRTYPE_TIME_OF_LAST_REQ     = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    //Host address lengths
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    public static final int ADDR_LEN_INET      = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
    public static final int ADDR_LEN_CHAOS     = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public static final int ADDR_LEN_OSI       = 0; //means variable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    public static final int ADDR_LEN_XNS       = 6;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    public static final int ADDR_LEN_APPLETALK = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
    public static final int ADDR_LEN_DECNET    = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    //Host address types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
    public static final int ADDRTYPE_UNIX      = 1;  // Local
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    public static final int ADDRTYPE_INET      = 2;  // Internet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    public static final int ADDRTYPE_IMPLINK   = 3;  // Arpanet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
    public static final int ADDRTYPE_PUP       = 4;  // PUP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public static final int ADDRTYPE_CHAOS     = 5;  // CHAOS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
    public static final int ADDRTYPE_XNS       = 6;  // XEROX Network Services
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
    public static final int ADDRTYPE_IPX       = 6;  // IPX
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    public static final int ADDRTYPE_ISO       = 7;  // ISO
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    public static final int ADDRTYPE_ECMA      = 8;  // European Computer Manufacturers
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    public static final int ADDRTYPE_DATAKIT   = 9;  // Datakit
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    public static final int ADDRTYPE_CCITT     = 10; // CCITT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public static final int ADDRTYPE_SNA       = 11; // SNA
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    public static final int ADDRTYPE_DECNET    = 12; // DECnet
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    public static final int ADDRTYPE_DLI       = 13; // Direct Data Link Interface
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
    public static final int ADDRTYPE_LAT       = 14; // LAT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    public static final int ADDRTYPE_HYLINK    = 15; // NSC Hyperchannel
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    public static final int ADDRTYPE_APPLETALK = 16; // AppleTalk
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    public static final int ADDRTYPE_NETBIOS   = 17; // NetBios
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
    public static final int ADDRTYPE_VOICEVIEW = 18; // VoiceView
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public static final int ADDRTYPE_FIREFOX   = 19; // Firefox
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    public static final int ADDRTYPE_BAN       = 21; // Banyan
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    public static final int ADDRTYPE_ATM       = 22; // ATM
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    public static final int ADDRTYPE_INET6     = 24; // Internet Protocol V6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    //IP Transport UDP Port for KDC Messages
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    public static final int KDC_INET_DEFAULT_PORT = 88;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    // number of retries before giving up
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    public static final int KDC_RETRY_LIMIT = 3;
16504
1e8ff2df7152 8009875: Provide a default udp_preference_limit for krb5.conf
weijun
parents: 14413
diff changeset
   136
    public static final int KDC_DEFAULT_UDP_PREF_LIMIT = 1465;
1e8ff2df7152 8009875: Provide a default udp_preference_limit for krb5.conf
weijun
parents: 14413
diff changeset
   137
    public static final int KDC_HARD_UDP_LIMIT = 32700;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    //OSI authentication mechanism OID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    //public static final int[] OSI_AUTH_MECH_TYPE = { /*iso*/ 1, /*org*/ 3,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    //                                               /*dod*/ 5, /*internet*/ 1, /*security*/ 5, /*kerberosv5*/ 2 };
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
    //Protocol constants and associated values
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    //Key Types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    public static final int KEYTYPE_NULL = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
    public static final int KEYTYPE_DES  = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
    public static final int KEYTYPE_DES3 = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    public static final int KEYTYPE_AES  = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    public static final int KEYTYPE_ARCFOUR_HMAC = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
    //----------------------------------------+-----------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    //                      padata type       |padata-type value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    //----------------------------------------+-----------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
    public static final int PA_TGS_REQ       = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public static final int PA_ENC_TIMESTAMP = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
    public static final int PA_PW_SALT       = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    // new preauth types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
    public static final int PA_ETYPE_INFO    = 11;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    public static final int PA_ETYPE_INFO2   = 19;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 5506
diff changeset
   166
    // S4U2user info
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 5506
diff changeset
   167
    public static final int PA_FOR_USER      = 129;
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents: 5506
diff changeset
   168
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 51398
diff changeset
   169
    // FAST (RFC 6806)
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 51398
diff changeset
   170
    public static final int PA_REQ_ENC_PA_REP = 149;
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 51398
diff changeset
   171
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    //-------------------------------+-------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
    //authorization data type        |ad-type value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    //-------------------------------+-------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
    //reserved values                 0-63
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public static final int OSF_DCE = 64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
    public static final int SESAME  = 65;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
    //----------------------------------------------+-----------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    //alternate authentication type                 |method-type value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
    //----------------------------------------------+-----------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
    //                      reserved values          0-63
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
    public static final int ATT_CHALLENGE_RESPONSE = 64;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
    //--------------------------------------------+-------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    //transited encoding type                     |tr-type value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    //--------------------------------------------+-------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    public static final int DOMAIN_X500_COMPRESS = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    //                      reserved values        all others
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    //----------------------------+-------+-----------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    //                      Label |Value  |Meaning
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    //----------------------------+-------+-----------------------------------------
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
    public static final int PVNO = 5;   // current Kerberos protocol version number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
    public static final int AUTHNETICATOR_VNO = 5;   // current authenticator version number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public static final int TICKET_VNO = 5;   // current ticket version number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    //message types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    // there are several message sub-components not included here
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public static final int KRB_AS_REQ =  10;     //Request for initial authentication
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
    public static final int KRB_AS_REP =  11;     //Response to KRB_AS_REQ request
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    public static final int KRB_TGS_REQ = 12;     //Request for authentication based on TGT
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    public static final int KRB_TGS_REP = 13;     //Response to KRB_TGS_REQ request
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    public static final int KRB_AP_REQ =  14;     //application request to server
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public static final int KRB_AP_REP =  15;     //Response to KRB_AP_REQ_MUTUAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public static final int KRB_SAFE =    20;     //Safe (checksummed) application message
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    public static final int KRB_PRIV =    21;     //Private (encrypted) application message
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
    public static final int KRB_CRED =    22;     //Private (encrypted) message to forward credentials
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public static final int KRB_ERROR =   30;     //Error response
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    //message component types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public static final int KRB_TKT               = 1;  //Ticket
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    public static final int KRB_AUTHENTICATOR     = 2;  //Authenticator
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    public static final int KRB_ENC_TKT_PART      = 3;  //Encrypted ticket part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public static final int KRB_ENC_AS_REP_PART   = 25; //Encrypted initial authentication part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    public static final int KRB_ENC_TGS_REP_PART  = 26; //Encrypted TGS request part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public static final int KRB_ENC_AP_REP_PART   = 27; //Encrypted application request part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    public static final int KRB_ENC_KRB_PRIV_PART = 28; //Encrypted application message part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    public static final int KRB_ENC_KRB_CRED_PART = 29; //Encrypted credentials forward part
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    //error codes
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public static final int KDC_ERR_NONE                 =  0;   //No error
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    public static final int KDC_ERR_NAME_EXP             =  1;   //Client's entry in database expired
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public static final int KDC_ERR_SERVICE_EXP          =  2;   //Server's entry in database has expired
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    public static final int KDC_ERR_BAD_PVNO             =  3;   //Requested protocol version number not supported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    public static final int KDC_ERR_C_OLD_MAST_KVNO      =  4;   //Client's key encrypted in old master key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    public static final int KDC_ERR_S_OLD_MAST_KVNO      =  5;   //Server's key encrypted in old master key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public static final int KDC_ERR_C_PRINCIPAL_UNKNOWN  =  6;   //Client not found in Kerberos database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
    public static final int KDC_ERR_S_PRINCIPAL_UNKNOWN  =  7;   //Server not found in Kerberos database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    public static final int KDC_ERR_PRINCIPAL_NOT_UNIQUE =  8;   //Multiple principal entries in database
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    public static final int KDC_ERR_NULL_KEY             =  9;   //The client or server has a null key
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
    public static final int KDC_ERR_CANNOT_POSTDATE      = 10;   //Ticket not eligible for postdating
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public static final int KDC_ERR_NEVER_VALID          = 11;   //Requested start time is later than end time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    public static final int KDC_ERR_POLICY               = 12;   //KDC policy rejects request
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
    public static final int KDC_ERR_BADOPTION            = 13;   //KDC cannot accommodate requested option
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    public static final int KDC_ERR_ETYPE_NOSUPP         = 14;   //KDC has no support for encryption type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    public static final int KDC_ERR_SUMTYPE_NOSUPP       = 15;   //KDC has no support for checksum type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    public static final int KDC_ERR_PADATA_TYPE_NOSUPP   = 16;   //KDC has no support for padata type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    public static final int KDC_ERR_TRTYPE_NOSUPP        = 17;   //KDC has no support for transited type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public static final int KDC_ERR_CLIENT_REVOKED       = 18;   //Clients credentials have been revoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    public static final int KDC_ERR_SERVICE_REVOKED      = 19;   //Credentials for server have been revoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    public static final int KDC_ERR_TGT_REVOKED          = 20;   //TGT has been revoked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    public static final int KDC_ERR_CLIENT_NOTYET        = 21;   //Client not yet valid - try again later
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    public static final int KDC_ERR_SERVICE_NOTYET       = 22;   //Server not yet valid - try again later
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    public static final int KDC_ERR_KEY_EXPIRED          = 23;   //Password has expired - change password to reset
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public static final int KDC_ERR_PREAUTH_FAILED       = 24;   //Pre-authentication information was invalid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
    public static final int KDC_ERR_PREAUTH_REQUIRED     = 25;   //Additional pre-authentication required
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    public static final int KRB_AP_ERR_BAD_INTEGRITY     = 31;   //Integrity check on decrypted field failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    public static final int KRB_AP_ERR_TKT_EXPIRED       = 32;   //Ticket expired
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
    public static final int KRB_AP_ERR_TKT_NYV           = 33;   //Ticket not yet valid
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    public static final int KRB_AP_ERR_REPEAT            = 34;   //Request is a replay
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    public static final int KRB_AP_ERR_NOT_US            = 35;   //The ticket isn't for us
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
    public static final int KRB_AP_ERR_BADMATCH          = 36;   //Ticket and authenticator don't match
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    public static final int KRB_AP_ERR_SKEW              = 37;   //Clock skew too great
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    public static final int KRB_AP_ERR_BADADDR           = 38;   //Incorrect net address
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
    public static final int KRB_AP_ERR_BADVERSION        = 39;   //Protocol version mismatch
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    public static final int KRB_AP_ERR_MSG_TYPE          = 40;   //Invalid msg type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
    public static final int KRB_AP_ERR_MODIFIED          = 41;   //Message stream modified
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    public static final int KRB_AP_ERR_BADORDER          = 42;   //Message out of order
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    public static final int KRB_AP_ERR_BADKEYVER         = 44;   //Specified version of key is not available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    public static final int KRB_AP_ERR_NOKEY             = 45;   //Service key not available
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    public static final int KRB_AP_ERR_MUT_FAIL          = 46;   //Mutual authentication failed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
    public static final int KRB_AP_ERR_BADDIRECTION      = 47;   //Incorrect message direction
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public static final int KRB_AP_ERR_METHOD            = 48;   //Alternative authentication method required
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
    public static final int KRB_AP_ERR_BADSEQ            = 49;   //Incorrect sequence number in message
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    public static final int KRB_AP_ERR_INAPP_CKSUM       = 50;   //Inappropriate type of checksum in message
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
    public static final int KRB_ERR_RESPONSE_TOO_BIG     = 52;   //Response too big for UDP, retry with TCP
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    public static final int KRB_ERR_GENERIC              = 60;   //Generic error (description in e-text)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    public static final int KRB_ERR_FIELD_TOOLONG        = 61;   //Field is too long for this implementation
55258
d65d3c37232c 8215032: Support Kerberos cross-realm referrals (RFC 6806)
mbalao
parents: 51398
diff changeset
   274
    public static final int KRB_ERR_WRONG_REALM          = 68;   //Wrong realm
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    public static final int KRB_CRYPTO_NOT_SUPPORT      = 100;    //Client does not support this crypto type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
    public static final int KRB_AP_ERR_NOREALM          = 62;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    public static final int KRB_AP_ERR_GEN_CRED         = 63;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
    //  public static final int KRB_AP_ERR_CKSUM_NOKEY          =101;    //Lack of the key to generate the checksum
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    // error codes specific to this implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
    public static final int KRB_AP_ERR_REQ_OPTIONS = 101; //Invalid TGS_REQ
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
    public static final int API_INVALID_ARG               = 400;  //Invalid argument
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    public static final int BITSTRING_SIZE_INVALID        = 500;  //BitString size does not match input byte array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    public static final int BITSTRING_INDEX_OUT_OF_BOUNDS = 501;  //BitString bit index does not fall within size
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    public static final int BITSTRING_BAD_LENGTH          = 502;  //BitString length is wrong for the expected type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
    public static final int REALM_ILLCHAR                 = 600;  //Illegal character in realm name; one of: '/', ':', '\0'
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    public static final int REALM_NULL                    = 601;  //Null realm name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    public static final int ASN1_BAD_TIMEFORMAT           = 900;  //Input not in GeneralizedTime format
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
    public static final int ASN1_MISSING_FIELD            = 901;  //Structure is missing a required field
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public static final int ASN1_MISPLACED_FIELD          = 902;  //Unexpected field number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    public static final int ASN1_TYPE_MISMATCH            = 903;  //Type numbers are inconsistent
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    public static final int ASN1_OVERFLOW                 = 904;  //Value too large
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
    public static final int ASN1_OVERRUN                  = 905;  //Encoding ended unexpectedly
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
    public static final int ASN1_BAD_ID                   = 906;  //Identifier doesn't match expected value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
    public static final int ASN1_BAD_LENGTH               = 907;  //Length doesn't match expected value
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
    public static final int ASN1_BAD_FORMAT               = 908;  //Badly-formatted encoding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
    public static final int ASN1_PARSE_ERROR              = 909;  //Parse error
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
    public static final int ASN1_BAD_CLASS                = 910;  //Bad class number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
    public static final int ASN1_BAD_TYPE                 = 911;  //Bad type number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
    public static final int ASN1_BAD_TAG                  = 912;  //Bad tag number
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    public static final int ASN1_UNSUPPORTED_TYPE         = 913;  //Unsupported ASN.1 type encountered
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    public static final int ASN1_CANNOT_ENCODE            = 914;  //Encoding failed due to invalid parameter(s)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    private static Hashtable<Integer,String> errMsgList;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
    public static String getErrorMessage(int i) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
        return errMsgList.get(i);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
58331
e4ce29f6094e 8228659: Record which Java methods are called by native codes in JGSS and JAAS
weijun
parents: 55258
diff changeset
   312
    // Warning: used by NativeCreds.c
51398
3c389a284345 8209416: Refactoring GetPropertyAction calls in security libs
weijun
parents: 47216
diff changeset
   313
    public static final boolean DEBUG = GetBooleanAction
3c389a284345 8209416: Refactoring GetPropertyAction calls in security libs
weijun
parents: 47216
diff changeset
   314
            .privilegedGetProperty("sun.security.krb5.debug");
3c389a284345 8209416: Refactoring GetPropertyAction calls in security libs
weijun
parents: 47216
diff changeset
   315
34687
d302ed125dc9 8144995: Move sun.misc.HexDumpEncoder to sun.security.util
chegar
parents: 25859
diff changeset
   316
    public static final sun.security.util.HexDumpEncoder hexDumper =
d302ed125dc9 8144995: Move sun.misc.HexDumpEncoder to sun.security.util
chegar
parents: 25859
diff changeset
   317
        new sun.security.util.HexDumpEncoder();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
        errMsgList = new Hashtable<Integer,String> ();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
        errMsgList.put(KDC_ERR_NONE, "No error");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        errMsgList.put(KDC_ERR_NAME_EXP, "Client's entry in database expired");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        errMsgList.put(KDC_ERR_SERVICE_EXP, "Server's entry in database has expired");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
        errMsgList.put(KDC_ERR_BAD_PVNO, "Requested protocol version number not supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        errMsgList.put(KDC_ERR_C_OLD_MAST_KVNO, "Client's key encrypted in old master key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
        errMsgList.put(KDC_ERR_S_OLD_MAST_KVNO, "Server's key encrypted in old master key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
        errMsgList.put(KDC_ERR_C_PRINCIPAL_UNKNOWN, "Client not found in Kerberos database");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
        errMsgList.put(KDC_ERR_S_PRINCIPAL_UNKNOWN, "Server not found in Kerberos database");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
        errMsgList.put(KDC_ERR_PRINCIPAL_NOT_UNIQUE, "Multiple principal entries in database");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        errMsgList.put(KDC_ERR_NULL_KEY, "The client or server has a null key");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
        errMsgList.put(KDC_ERR_CANNOT_POSTDATE, "Ticket not eligible for postdating");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        errMsgList.put(KDC_ERR_NEVER_VALID, "Requested start time is later than end time");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
        errMsgList.put(KDC_ERR_POLICY, "KDC policy rejects request");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        errMsgList.put(KDC_ERR_BADOPTION, "KDC cannot accommodate requested option");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
        errMsgList.put(KDC_ERR_ETYPE_NOSUPP, "KDC has no support for encryption type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        errMsgList.put(KDC_ERR_SUMTYPE_NOSUPP, "KDC has no support for checksum type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        errMsgList.put(KDC_ERR_PADATA_TYPE_NOSUPP, "KDC has no support for padata type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        errMsgList.put(KDC_ERR_TRTYPE_NOSUPP, "KDC has no support for transited type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
        errMsgList.put(KDC_ERR_CLIENT_REVOKED, "Clients credentials have been revoked");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
        errMsgList.put(KDC_ERR_SERVICE_REVOKED, "Credentials for server have been revoked");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
        errMsgList.put(KDC_ERR_TGT_REVOKED, "TGT has been revoked");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
        errMsgList.put(KDC_ERR_CLIENT_NOTYET, "Client not yet valid - try again later");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
        errMsgList.put(KDC_ERR_SERVICE_NOTYET, "Server not yet valid - try again later");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
        errMsgList.put(KDC_ERR_KEY_EXPIRED, "Password has expired - change password to reset");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        errMsgList.put(KDC_ERR_PREAUTH_FAILED, "Pre-authentication information was invalid");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
        errMsgList.put(KDC_ERR_PREAUTH_REQUIRED, "Additional pre-authentication required");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        errMsgList.put(KRB_AP_ERR_BAD_INTEGRITY, "Integrity check on decrypted field failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        errMsgList.put(KRB_AP_ERR_TKT_EXPIRED, "Ticket expired");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        errMsgList.put(KRB_AP_ERR_TKT_NYV, "Ticket not yet valid");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
        errMsgList.put(KRB_AP_ERR_REPEAT, "Request is a replay");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
        errMsgList.put(KRB_AP_ERR_NOT_US, "The ticket isn't for us");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
        errMsgList.put(KRB_AP_ERR_BADMATCH, "Ticket and authenticator don't match");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
        errMsgList.put(KRB_AP_ERR_SKEW, "Clock skew too great");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
        errMsgList.put(KRB_AP_ERR_BADADDR, "Incorrect net address");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        errMsgList.put(KRB_AP_ERR_BADVERSION, "Protocol version mismatch");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        errMsgList.put(KRB_AP_ERR_MSG_TYPE, "Invalid msg type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        errMsgList.put(KRB_AP_ERR_MODIFIED, "Message stream modified");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        errMsgList.put(KRB_AP_ERR_BADORDER, "Message out of order");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
        errMsgList.put(KRB_AP_ERR_BADKEYVER, "Specified version of key is not available");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        errMsgList.put(KRB_AP_ERR_NOKEY, "Service key not available");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        errMsgList.put(KRB_AP_ERR_MUT_FAIL, "Mutual authentication failed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        errMsgList.put(KRB_AP_ERR_BADDIRECTION, "Incorrect message direction");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        errMsgList.put(KRB_AP_ERR_METHOD, "Alternative authentication method required");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
        errMsgList.put(KRB_AP_ERR_BADSEQ, "Incorrect sequence number in message");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        errMsgList.put(KRB_AP_ERR_INAPP_CKSUM, "Inappropriate type of checksum in message");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
        errMsgList.put(KRB_ERR_RESPONSE_TOO_BIG, "Response too big for UDP, retry with TCP");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
        errMsgList.put(KRB_ERR_GENERIC, "Generic error (description in e-text)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
        errMsgList.put(KRB_ERR_FIELD_TOOLONG, "Field is too long for this implementation");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
        errMsgList.put(KRB_AP_ERR_NOREALM, "Realm name not available"); //used in setDefaultCreds() in sun.security.krb5.Credentials
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        // error messages specific to this implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
        errMsgList.put(API_INVALID_ARG, "Invalid argument");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
        errMsgList.put(BITSTRING_SIZE_INVALID, "BitString size does not match input byte array");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
        errMsgList.put(BITSTRING_INDEX_OUT_OF_BOUNDS, "BitString bit index does not fall within size");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        errMsgList.put(BITSTRING_BAD_LENGTH, "BitString length is wrong for the expected type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        errMsgList.put(REALM_ILLCHAR, "Illegal character in realm name; one of: '/', ':', '\0'");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        errMsgList.put(REALM_NULL, "Null realm name");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
        errMsgList.put(ASN1_BAD_TIMEFORMAT, "Input not in GeneralizedTime format");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        errMsgList.put(ASN1_MISSING_FIELD, "Structure is missing a required field");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        errMsgList.put(ASN1_MISPLACED_FIELD, "Unexpected field number");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        errMsgList.put(ASN1_TYPE_MISMATCH, "Type numbers are inconsistent");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        errMsgList.put(ASN1_OVERFLOW, "Value too large");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        errMsgList.put(ASN1_OVERRUN, "Encoding ended unexpectedly");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        errMsgList.put(ASN1_BAD_ID, "Identifier doesn't match expected value");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
        errMsgList.put(ASN1_BAD_LENGTH, "Length doesn't match expected value");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        errMsgList.put(ASN1_BAD_FORMAT, "Badly-formatted encoding");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        errMsgList.put(ASN1_PARSE_ERROR, "Parse error");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        errMsgList.put(ASN1_BAD_CLASS, "Bad class number");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        errMsgList.put(ASN1_BAD_TYPE, "Bad type number");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
        errMsgList.put(ASN1_BAD_TAG, "Bad tag number");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
        errMsgList.put(ASN1_UNSUPPORTED_TYPE, "Unsupported ASN.1 type encountered");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
        errMsgList.put(ASN1_CANNOT_ENCODE, "Encoding failed due to invalid parameter(s)");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        errMsgList.put(KRB_CRYPTO_NOT_SUPPORT, "Client has no support for crypto type");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        errMsgList.put(KRB_AP_ERR_REQ_OPTIONS, "Invalid option setting in ticket request.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        errMsgList.put(KRB_AP_ERR_GEN_CRED, "Fail to create credential.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
}