// XXX BUG #497 START CODE SNIPPET MOVED TO INTEL HOST AGENT
String nonce = generateNonce();
String sessionId = generateSessionId();
ClientRequestType clientRequestType = client.getQuote(nonce, pcrList);
log.info( "got response from server ["+hostname+"] "+clientRequestType);
String quote = clientRequestType.getQuote();
log.info( "extracted quote from response: "+quote);
saveQuote(quote, sessionId);
log.info( "saved quote with session id: "+sessionId);
// we only need to save the certificate when registring the host ... when we are just getting a quote we need to verify it using the previously saved AIK.
if( trustedAik == null ) {
String aikCertificate = clientRequestType.getAikcert();
log.info( "extracted aik cert from response: "+aikCertificate);
saveCertificate(aikCertificate, sessionId);
log.info( "saved host-provided AIK certificate with session id: "+sessionId);
}