Skip to content

Commit

Permalink
OF-1590 Validate h against resumed session
Browse files Browse the repository at this point in the history
The `<resume/>` element sent by the client during a XEP-0198 session
resumption contains an `h` attribute which is validated to ensure it
has not acknowledged more stanzas than were actually sent.

However, we were validating that against the current session, whose
counters would be disabled, and therefore left at zero. This simply
checks them against the correct session instead - the `otherSession`
which is to be resumed.
  • Loading branch information
dwd authored and guusdk committed Aug 16, 2018
1 parent 4346258 commit cfb3e7d
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -274,7 +274,7 @@ private void startResume(String namespace, String previd, long h) {
sendError(new PacketError(PacketError.Condition.unexpected_request));
return;
}
if (!validateClientAcknowledgement(h)) {
if (!otherSession.getStreamManager().validateClientAcknowledgement(h)) {
Log.debug("Not allowing a client to resume a session, as it reports it received more stanzas from us than that we've send it." );
sendError(new PacketError(PacketError.Condition.unexpected_request));
return;
Expand Down

0 comments on commit cfb3e7d

Please sign in to comment.