aboutsummaryrefslogtreecommitdiff
path: root/src/iperf_auth.c
diff options
context:
space:
mode:
authorBruce A. Mah <bmah@kitchenlab.org>2018-01-02 14:55:01 -0800
committerGitHub <noreply@github.com>2018-01-02 14:55:01 -0800
commit1e93fdcf882dc242a5a5ccdaa3c79b25cc557082 (patch)
tree40209fea873a15a811d553fc716e1b8129ab4694 /src/iperf_auth.c
parenteddfb8267e196f9f96cd80b5e99238f9ffe48f97 (diff)
downloadiperf3-1e93fdcf882dc242a5a5ccdaa3c79b25cc557082.tar.gz
Fix comparison when checking for time skew when using authentication. (#674)
Fixes #673. Submitted by @FuzzyStatic, reviewed by @ralcini.
Diffstat (limited to 'src/iperf_auth.c')
-rw-r--r--src/iperf_auth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/iperf_auth.c b/src/iperf_auth.c
index 5ba2e08..d0484e4 100644
--- a/src/iperf_auth.c
+++ b/src/iperf_auth.c
@@ -62,7 +62,7 @@ void sha256(const char *string, char outputBuffer[65])
int check_authentication(const char *username, const char *password, const time_t ts, const char *filename){
time_t t = time(NULL);
time_t utc_seconds = mktime(localtime(&t));
- if ( (utc_seconds - ts) < 10 && (utc_seconds - ts) > 0 ){
+ if ( (utc_seconds - ts) > 10 || (utc_seconds - ts) < -10 ) {
return 1;
}