/**
* {@inheritDoc}
*/
public void action( KrbSafeContainer krbSafeContainer ) throws DecoderException
{
TLV tlv = krbSafeContainer.getCurrentTLV();
// The Length should not be null
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 HostAddress
Asn1Decoder krbSafeBodyDecoder = new Asn1Decoder();
KrbSafeBodyContainer krbSafeBodyContainer = new KrbSafeBodyContainer();
// Passes the Stream to the decoder
krbSafeBodyContainer.setStream( krbSafeContainer.getStream() );
// Decode the KrbSafeBody PDU
try
{
krbSafeBodyDecoder.decode( krbSafeContainer.getStream(), krbSafeBodyContainer );
}
catch ( DecoderException de )
{
throw de;
}
// Store the KrbSafeBody in the container
KrbSafeBody krbSafeBody = krbSafeBodyContainer.getKrbSafeBody();
if ( IS_DEBUG )
{
LOG.debug( "KrbSafeBody : {}", krbSafeBody );
}
krbSafeContainer.getKrbSafe().setSafeBody( krbSafeBody );
// Update the expected length for the current TLV
tlv.setExpectedLength( tlv.getExpectedLength() - tlv.getLength() );
// Update the parent
krbSafeContainer.updateParent();
}