Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overflow when checking for delay attacks #24

Closed
sijohans opened this issue Feb 6, 2018 · 0 comments
Closed

Overflow when checking for delay attacks #24

sijohans opened this issue Feb 6, 2018 · 0 comments

Comments

@sijohans
Copy link
Contributor

sijohans commented Feb 6, 2018

From review:

https://github.com/assaabloy-ppi/salt-channel-c/blob/master/src/salti_util.c#L303

 if (t_arrival - p_channel->peer_epoch > t_package + p_channel->delay_threshold) {
    /* Delay detected */
    SALT_ERROR(SALT_ERR_DELAY_DETECTED);
}

Issues:

  • This does not handle integer overflow nicely, left side may
    underflow, right side may overflow; behavior is unpredictable on
    extreme values.
  • This check “larger than” condition instead of “is absolute difference
    larger than”, i.e. only one out of two type of clock drift and
    strange timing issues is detected.
sijohans pushed a commit that referenced this issue Feb 19, 2018
sijohans pushed a commit that referenced this issue Mar 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant