Skip to content

Commit

Permalink
Fix ESP replay integer overflow problems
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Aug 30, 2016
1 parent dadfde8 commit 1663acb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions esp.c
Expand Up @@ -57,7 +57,7 @@ int verify_packet_seqno(struct openconnect_info *vpninfo,
_("Accepting expected ESP packet with seq %u\n"),
seq);
return 0;
} else if (seq + 33 < esp->seq) {
} else if (esp->seq > 33 && seq < esp->seq - 33) {
/* Too old. We can't know if it's a replay. */
vpn_progress(vpninfo, PRG_DEBUG,
_("Discarding ancient ESP packet with seq %u (expected %u)\n"),
Expand All @@ -80,7 +80,7 @@ int verify_packet_seqno(struct openconnect_info *vpninfo,
return -EINVAL;
} else {
/* The packet we were expecting has gone missing; this one is newer. */
int delta = seq - esp->seq;
uint32_t delta = seq - esp->seq;

if (delta >= 32) {
/* We jumped a long way into the future. We have not seen
Expand Down
1 change: 1 addition & 0 deletions www/changelog.xml
Expand Up @@ -15,6 +15,7 @@
<ul>
<li><b>OpenConnect HEAD</b>
<ul>
<li>Fix integer overflow issues with ESP packet replay detection.</li>
<li>Add <tt>--pass-tos</tt> option as in OpenVPN.</li>
<li>Support rôle selection form in Juniper VPN.</li>
<li>Support DER-format certificates, add certificate format torture tests.</li>
Expand Down

0 comments on commit 1663acb

Please sign in to comment.