if(session.transport.digest == null &&
(session.transport.server.signaturesRequired ||
(session.transport.server.signaturesEnabled && SmbConstants.SIGNPREF))){
Key key = context.searchSessionKey(subject);
if(key == null){
throw new SmbException("Not found the session key.");
}
request.digest = new SigningDigest(key.getEncoded());
}
session.transport.send( request, response );
session.transport.digest = request.digest;
token = response.getSecurityBlob().get();
}
}
session.setUid(response.uid);
session.setSessionSetup(true);
}catch (GSSException e) {
e.printStackTrace();
throw new SmbException(e.getMessage());
}finally{
if(context != null){
try {context.dispose();} catch (GSSException e) {}
}
}