]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: explicit long long type in timing calculations (doesn't
authordjm@openbsd.org <djm@openbsd.org>
Mon, 28 Aug 2023 04:06:52 +0000 (04:06 +0000)
committerDamien Miller <djm@mindrot.org>
Mon, 28 Aug 2023 04:07:56 +0000 (14:07 +1000)
matter, since the range is pre-clamped)

OpenBSD-Commit-ID: f786ed902d04a5b8ecc581d068fea1a79aa772de

clientloop.c

index 94ff2cb9b93d8e8a72fd44b4ba17c4f53caa5112..a0c3ed8d0942341e6ecc3b596ee96ee3147cb429 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: clientloop.c,v 1.393 2023/08/28 03:31:16 djm Exp $ */
+/* $OpenBSD: clientloop.c,v 1.394 2023/08/28 04:06:52 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -618,9 +618,9 @@ obfuscate_keystroke_timing(struct ssh *ssh, struct timespec *timeout)
                return 0;
 
        /* Calculate number of intervals missed since the last check */
-       n = (now.tv_sec - next_interval.tv_sec) * 1000 * 1000 * 1000;
+       n = (now.tv_sec - next_interval.tv_sec) * 1000LL * 1000 * 1000;
        n += now.tv_nsec - next_interval.tv_nsec;
-       n /= options.obscure_keystroke_timing_interval * 1000 * 1000;
+       n /= options.obscure_keystroke_timing_interval * 1000LL * 1000;
        n = (n < 0) ? 1 : n + 1;
 
        /* Advance to the next interval */