if ( tlv.getLength() == 0 )
{
LOG.error( I18n.err( I18n.ERR_04066 ) );
// This will generate a PROTOCOL_ERROR
throw new DecoderException( I18n.err( I18n.ERR_04067 ) );
}
// Now, let's decode the KDC-REP
Asn1Decoder kdcRepDecoder = new Asn1Decoder();
KdcRepContainer kdcRepContainer = new KdcRepContainer( tgsRepContainer.getStream() );
// Store the created TGS-REP object into the KDC-REP container
TgsRep tgsRep = new TgsRep();
kdcRepContainer.setKdcRep( tgsRep );
// Decode the KDC_REP PDU
try
{
kdcRepDecoder.decode( tgsRepContainer.getStream(), kdcRepContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
tgsRepContainer.updateParent();
if ( tgsRep.getMessageType() != KerberosMessageType.TGS_REP )
{
throw new DecoderException( "Bad message type" );
}
tgsRepContainer.setTgsRep( tgsRep );
if ( IS_DEBUG )