summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keygen.c
diff options
context:
space:
mode:
authordjm <djm@openbsd.org>2018-02-10 05:48:46 +0000
committerdjm <djm@openbsd.org>2018-02-10 05:48:46 +0000
commit3af9300f716ab9573045890659953e04f99befe1 (patch)
treef7b5589764d82cc7c0c3c757fdcb76c419ac01e0 /usr.bin/ssh/ssh-keygen.c
parentfatal if we're unable to write all the public key; previously we (diff)
downloadwireguard-openbsd-3af9300f716ab9573045890659953e04f99befe1.tar.xz
wireguard-openbsd-3af9300f716ab9573045890659953e04f99befe1.zip
Refuse to create a certificate with an unusable number of principals;
Prompted by gdestuynder via github
Diffstat (limited to 'usr.bin/ssh/ssh-keygen.c')
-rw-r--r--usr.bin/ssh/ssh-keygen.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/ssh/ssh-keygen.c b/usr.bin/ssh/ssh-keygen.c
index 715025b3fb0..4e45d7d70aa 100644
--- a/usr.bin/ssh/ssh-keygen.c
+++ b/usr.bin/ssh/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.311 2018/02/10 05:43:26 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.312 2018/02/10 05:48:46 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -1681,6 +1681,8 @@ do_ca_sign(struct passwd *pw, int argc, char **argv)
}
free(otmp);
}
+ if (n > SSHKEY_CERT_MAX_PRINCIPALS)
+ fatal("Too many certificate principals specified");
tmp = tilde_expand_filename(argv[i], pw->pw_uid);
if ((r = sshkey_load_public(tmp, &public, &comment)) != 0)