summaryrefslogtreecommitdiffstats
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorderaadt@openbsd.org <deraadt@openbsd.org>2015-01-16 06:40:12 +0000
committerDamien Miller <djm@mindrot.org>2015-01-16 18:24:48 +1100
commit2ae4f337b2a5fb2841b6b0053b49496fef844d1c (patch)
tree59aac6ef59be3975eb3a1251abb0be330c008cdd /ssh-keygen.c
parent3c4726f4c24118e8f1bb80bf75f1456c76df072c (diff)
upstream commit
Replace <sys/param.h> with <limits.h> and other less dirty headers where possible. Annotate <sys/param.h> lines with their current reasons. Switch to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc. Change MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where sensible to avoid pulling in the pollution. These are the files confirmed through binary verification. ok guenther, millert, doug (helped with the verification protocol)
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index c8b05e07..9f6106d4 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keygen.c,v 1.252 2015/01/15 09:40:00 djm Exp $ */
+/* $OpenBSD: ssh-keygen.c,v 1.253 2015/01/16 06:40:12 deraadt Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -17,7 +17,6 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/param.h>
#ifdef WITH_OPENSSL
#include <openssl/evp.h>
@@ -37,6 +36,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+#include <limits.h>
#include "xmalloc.h"
#include "sshkey.h"
@@ -1065,7 +1065,7 @@ do_known_hosts(struct passwd *pw, const char *name)
FILE *in, *out = stdout;
struct sshkey *pub;
char *cp, *cp2, *kp, *kp2;
- char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN];
+ char line[16*1024], tmp[PATH_MAX], old[PATH_MAX];
int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0;
int r, ca, revoked;
int found_key = 0;
@@ -2291,9 +2291,9 @@ usage(void)
int
main(int argc, char **argv)
{
- char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2;
+ char dotsshdir[PATH_MAX], comment[1024], *passphrase1, *passphrase2;
char *checkpoint = NULL;
- char out_file[MAXPATHLEN], *rr_hostname = NULL, *ep;
+ char out_file[PATH_MAX], *rr_hostname = NULL, *ep;
struct sshkey *private, *public;
struct passwd *pw;
struct stat st;
@@ -2513,7 +2513,7 @@ main(int argc, char **argv)
fatal("Output filename too long");
break;
case 'K':
- if (strlen(optarg) >= MAXPATHLEN)
+ if (strlen(optarg) >= PATH_MAX)
fatal("Checkpoint filename too long");
checkpoint = xstrdup(optarg);
break;