]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- djm@cvs.openbsd.org 2014/02/23 20:03:42
authorDamien Miller <djm@mindrot.org>
Mon, 24 Feb 2014 04:57:22 +0000 (15:57 +1100)
committerDamien Miller <djm@mindrot.org>
Mon, 24 Feb 2014 04:57:22 +0000 (15:57 +1100)
     [ssh-ed25519.c]
     check for unsigned overflow; not reachable in OpenSSH but others might
     copy our code...

ChangeLog
ssh-ed25519.c

index a5cb06484a14dceb7af63c39244243326d43a44e..e05b8698c4db19dc6fb894ecaecbe05c5761d4f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [readconf.c]
      when processing Match blocks, skip 'exec' clauses if previous predicates
      failed to match; ok markus@
+   - djm@cvs.openbsd.org 2014/02/23 20:03:42
+     [ssh-ed25519.c]
+     check for unsigned overflow; not reachable in OpenSSH but others might
+     copy our code...
 
 20140213
  - (dtucker) [configure.ac openbsd-compat/openssl-compat.{c,h}]  Add compat
index 56c480df212141887e393c51b7166137389f2d77..160d1f23bf8d37bb4386ed69f5bedf5bbdf38b0e 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-ed25519.c,v 1.2 2014/02/02 03:44:31 djm Exp $ */
+/* $OpenBSD: ssh-ed25519.c,v 1.3 2014/02/23 20:03:42 djm Exp $ */
 /*
  * Copyright (c) 2013 Markus Friedl <markus@openbsd.org>
  *
@@ -21,6 +21,7 @@
 
 #include "crypto_api.h"
 
+#include <limits.h>
 #include <string.h>
 #include <stdarg.h>
 
@@ -45,6 +46,11 @@ ssh_ed25519_sign(const Key *key, u_char **sigp, u_int *lenp,
                error("%s: no ED25519 key", __func__);
                return -1;
        }
+
+       if (datalen >= UINT_MAX - crypto_sign_ed25519_BYTES) {
+               error("%s: datalen %u too long", __func__, datalen);
+               return -1;
+       }
        smlen = slen = datalen + crypto_sign_ed25519_BYTES;
        sig = xmalloc(slen);