/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* (C) Copyright IBM Corp. 1999 All Rights Reserved.
* Copyright 1997 The Open Group Research Institute. All rights reserved.
*/
/**
* This class extends KrbDataInputStream. It is used for parsing FCC-format
* data from file to memory.
*
* @author Yanni Zhang
*
*/
/*
* FCC version 2 contains type information for principals. FCC
* version 1 does not.
*
* FCC version 3 contains keyblock encryption type information, and is
* architecture independent. Previous versions are not.
*
* The code will accept version 1, 2, and 3 ccaches, and depending
* what KRB5_FCC_DEFAULT_FVNO is set to, it will create version 1, 2,
* or 3 FCC caches.
*
* The default credentials cache should be type 3 for now (see
* init_ctx.c).
*/
/* V4 of the credentials cache format allows for header tags */
super(is);
}
/* Read tag field introduced in KRB5_FCC_FVNO_4 */
// this needs to be public for Kinit.
char[] buf = new char[1024];
byte[] bytes;
int len;
int tag = -1;
int taglen;
if (len < 0) {
throw new IOException("stop.");
}
throw new IOException("Invalid tag length.");
}
while (len > 0) {
switch (tag) {
case FCC_TAG_DELTATIME:
break;
default:
}
}
if (tag == -1) {
}
return result;
}
/*
* In file-based credential cache, the realm name is stored as part of
* principal name at the first place.
*/
// made public for KinitOptions to call directly
/* Read principal type */
if (version == KRB5_FCC_FVNO_1) {
} else {
}
/*
* DCE includes the principal's realm in the count; the new format
* does not.
*/
if (version == KRB5_FCC_FVNO_1)
length--;
for (int i = 0; i <= length; i++) {
if (namelength > MAXNAMELENGTH) {
throw new IOException("Invalid name length in principal name.");
}
byte[] bytes = new byte[namelength];
}
}
return p;
}
/*
* In practice, a realm is named by uppercasing the DNS domain name. we currently
* rely on this to determine if the string within the principal identifier is realm
* name.
*
*/
try {
}
catch (Exception e) {
return false;
}
String s;
while (st.hasMoreTokens()) {
for (int i = 0; i < s.length(); i++) {
if (s.charAt(i) >= 141) {
return false;
}
}
}
return true;
}
if (version == KRB5_FCC_FVNO_3)
for (int i = 0; i < keyLen; i++) {
}
}
long[] times = new long[4];
return times;
}
if (read() == 0) {
return false;
}
else return true;
}
if (numAddrs > 0) {
for (int i = 0; i < numAddrs; i++) {
if (DEBUG) {
}
return null;
}
byte[] result = new byte[addrLength];
for (int j = 0; j < addrLength; j++)
}
return addrs;
}
return null;
}
if (num > 0) {
for (int i = 0; i < num; i++) {
for (int j = 0; j < adlength; j++) {
}
}
return auData;
}
else return null;
}
int length;
if (length == 0) {
return null;
} else {
return bytes;
}
}
int ticketFlags;
flags[1] = true;
flags[2] = true;
flags[3] = true;
flags[4] = true;
flags[5] = true;
flags[6] = true;
flags[7] = true;
flags[8] = true;
flags[9] = true;
flags[10] = true;
flags[11] = true;
if (DEBUG) {
if (flags[1] == true) {
msg += " FORWARDABLE;";
}
if (flags[2] == true) {
msg += " FORWARDED;";
}
if (flags[3] == true) {
msg += " PROXIABLE;";
}
if (flags[4] == true) {
msg += " PROXY;";
}
if (flags[5] == true) {
msg += " MAY_POSTDATE;";
}
if (flags[6] == true) {
msg += " POSTDATED;";
}
if (flags[7] == true) {
msg += " INVALID;";
}
if (flags[8] == true) {
msg += " RENEWABLE;";
}
if (flags[9] == true) {
msg += " INITIAL;";
}
if (flags[10] == true) {
msg += " PRE_AUTH;";
}
if (flags[11] == true) {
msg += " HW_AUTH;";
}
}
return flags;
}
/**
* Reads the next cred in stream.
* @return the next cred, null if ticket or second_ticket unparseable.
*
* Note: MIT krb5 1.8.1 might generate a config entry with server principal
* X-CACHECONF:/krb5_ccache_conf_data/fast_avail/krbtgt/REALM@REALM. The
* entry is used by KDC to inform the client that it support certain
* features. Its ticket is not a valid krb5 ticket and thus this method
* returns null.
*/
Credentials readCred(int version) throws IOException,RealmException, KrbApErrException, Asn1Exception {
if (DEBUG)
if (DEBUG)
if (DEBUG)
if (DEBUG) {
}
}
}
byte[] ticketData = readData();
byte[] ticketData2 = readData();
try {
} catch (Exception e) { // If any of new Ticket(*) fails.
return null;
}
}
}