throw new KerberosException( ( KrbError ) kdcRep );
}
TgsRep rep = ( TgsRep ) kdcRep;
byte[] decryptedData = cipherTextHandler.decrypt( sessionKey, rep.getEncPart(), KeyUsage.TGS_REP_ENC_PART_TGS_SESS_KEY );
EncTgsRepPart encTgsRepPart = KerberosDecoder.decodeEncTgsRepPart( decryptedData );
if ( currentNonce != encTgsRepPart.getEncKdcRepPart().getNonce() )
{
throw new KerberosException( ErrorType.KRB_ERR_GENERIC, "received nonce didn't match with the nonce sent in the request" );
}
// Everything is fine, return the response
LOG.debug( "TGT request successful : {}", rep );
ServiceTicket srvTkt = new ServiceTicket( rep.getTicket(), encTgsRepPart.getEncKdcRepPart() );
return srvTkt;
}
catch( KerberosException e )
{