throw new Exception("Not yet implemented for remote sessions");
}
}
private boolean validateLocalSession(String jid, String signature) {
Session session = sessionManager.getSession(new JID(jid));
// Does a valid session exist ?
if (session == null || !session.validate()) {
return false;
}
// Is the session authenticated ?
if (session.getStatus() != Session.STATUS_AUTHENTICATED) {
return false;
}
// Is the provided signature correct ?
// TODO the signature should be a hash of stuff...
String streamID = session.getStreamID().getID();
System.out.println("Validating signature " + signature + " against ID " + streamID);
if (!streamID.equals(signature)) {
return false;
}