summaryrefslogtreecommitdiff
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 c8b05e079..9f6106d47 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.252 2015/01/15 09:40:00 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.253 2015/01/16 06:40:12 deraadt Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -17,7 +17,6 @@
17#include <sys/types.h> 17#include <sys/types.h>
18#include <sys/socket.h> 18#include <sys/socket.h>
19#include <sys/stat.h> 19#include <sys/stat.h>
20#include <sys/param.h>
21 20
22#ifdef WITH_OPENSSL 21#ifdef WITH_OPENSSL
23#include <openssl/evp.h> 22#include <openssl/evp.h>
@@ -37,6 +36,7 @@
37#include <stdlib.h> 36#include <stdlib.h>
38#include <string.h> 37#include <string.h>
39#include <unistd.h> 38#include <unistd.h>
39#include <limits.h>
40 40
41#include "xmalloc.h" 41#include "xmalloc.h"
42#include "sshkey.h" 42#include "sshkey.h"
@@ -1065,7 +1065,7 @@ do_known_hosts(struct passwd *pw, const char *name)
1065 FILE *in, *out = stdout; 1065 FILE *in, *out = stdout;
1066 struct sshkey *pub; 1066 struct sshkey *pub;
1067 char *cp, *cp2, *kp, *kp2; 1067 char *cp, *cp2, *kp, *kp2;
1068 char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN]; 1068 char line[16*1024], tmp[PATH_MAX], old[PATH_MAX];
1069 int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0; 1069 int c, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0;
1070 int r, ca, revoked; 1070 int r, ca, revoked;
1071 int found_key = 0; 1071 int found_key = 0;
@@ -2291,9 +2291,9 @@ usage(void)
2291int 2291int
2292main(int argc, char **argv) 2292main(int argc, char **argv)
2293{ 2293{
2294 char dotsshdir[MAXPATHLEN], comment[1024], *passphrase1, *passphrase2; 2294 char dotsshdir[PATH_MAX], comment[1024], *passphrase1, *passphrase2;
2295 char *checkpoint = NULL; 2295 char *checkpoint = NULL;
2296 char out_file[MAXPATHLEN], *rr_hostname = NULL, *ep; 2296 char out_file[PATH_MAX], *rr_hostname = NULL, *ep;
2297 struct sshkey *private, *public; 2297 struct sshkey *private, *public;
2298 struct passwd *pw; 2298 struct passwd *pw;
2299 struct stat st; 2299 struct stat st;
@@ -2513,7 +2513,7 @@ main(int argc, char **argv)
2513 fatal("Output filename too long"); 2513 fatal("Output filename too long");
2514 break; 2514 break;
2515 case 'K': 2515 case 'K':
2516 if (strlen(optarg) >= MAXPATHLEN) 2516 if (strlen(optarg) >= PATH_MAX)
2517 fatal("Checkpoint filename too long"); 2517 fatal("Checkpoint filename too long");
2518 checkpoint = xstrdup(optarg); 2518 checkpoint = xstrdup(optarg);
2519 break; 2519 break;