{
throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
}
byte[] bodyBytes = buf.array();
Checksum authenticatorChecksum = tgsContext.getAuthenticator().getCksum();
// we need the session key
Ticket tgt = tgsContext.getTgt();
EncTicketPart encTicketPart = tgt.getEncTicketPart();
EncryptionKey sessionKey = encTicketPart.getKey();
if ( authenticatorChecksum == null || authenticatorChecksum.getChecksumType() == null
|| authenticatorChecksum.getChecksumValue() == null || bodyBytes == null )
{
throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
}
LOG.debug( "Verifying body checksum type '{}'.", authenticatorChecksum.getChecksumType() );
checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, sessionKey.getKeyValue(),
KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_AUTHNT_CKSUM_TGS_SESS_KEY );
}
}