]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: cap the number of permiopen/permitlisten directives we're
authordjm@openbsd.org <djm@openbsd.org>
Tue, 9 Jul 2019 04:15:00 +0000 (04:15 +0000)
committerDamien Miller <djm@mindrot.org>
Tue, 9 Jul 2019 04:20:15 +0000 (14:20 +1000)
willing to parse on a single authorized_keys line; ok deraadt@

OpenBSD-Commit-ID: a43a752c2555d26aa3fc754805a476f6e3e30f46

auth-options.c
auth-options.h

index 4923a83b76e549ecdb62b20c74890f2e6fc41c1b..51422188296b5e45ab5b85394d0b004ba987cdb9 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.c,v 1.85 2019/06/27 18:03:37 deraadt Exp $ */
+/* $OpenBSD: auth-options.c,v 1.86 2019/07/09 04:15:00 djm Exp $ */
 /*
  * Copyright (c) 2018 Damien Miller <djm@mindrot.org>
  *
@@ -320,7 +320,7 @@ handle_permit(const char **optsp, int allow_bare_port,
        size_t npermits = *npermitsp;
        const char *errstr = "unknown error";
 
-       if (npermits > INT_MAX) {
+       if (npermits > SSH_AUTHOPT_PERMIT_MAX) {
                *errstrp = "too many permission directives";
                return -1;
        }
index 0462983b5d89fc97b8b47c2fedb9d95c95871f1f..14cbfa49dc741c01534acfe5a341c3c28d7a8b92 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: auth-options.h,v 1.27 2018/06/06 18:23:32 djm Exp $ */
+/* $OpenBSD: auth-options.h,v 1.28 2019/07/09 04:15:00 djm Exp $ */
 
 /*
  * Copyright (c) 2018 Damien Miller <djm@mindrot.org>
@@ -22,6 +22,9 @@
 struct passwd;
 struct sshkey;
 
+/* Maximum number of permitopen/permitlisten directives to accept */
+#define SSH_AUTHOPT_PERMIT_MAX 4096
+
 /*
  * sshauthopt represents key options parsed from authorized_keys or
  * from certificate extensions/options.