From ca5450d695d8f9e6bd3120068d652f29e732ef3e Mon Sep 17 00:00:00 2001 From: dtucker Date: Mon, 11 Jan 2021 02:12:57 +0000 Subject: Change convtime() from returning long to returning int. On platforms where sizeof(int) != sizeof(long), convtime could accept values >MAX_INT which subsequently truncate when stored in an int during config parsing. bz#3250, ok djm@ --- usr.bin/ssh/ssh-add.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'usr.bin/ssh/ssh-add.c') diff --git a/usr.bin/ssh/ssh-add.c b/usr.bin/ssh/ssh-add.c index e317396d2aa..ade339fe1b4 100644 --- a/usr.bin/ssh/ssh-add.c +++ b/usr.bin/ssh/ssh-add.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-add.c,v 1.158 2020/10/18 11:32:02 djm Exp $ */ +/* $OpenBSD: ssh-add.c,v 1.159 2021/01/11 02:12:58 dtucker Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -84,7 +84,7 @@ static char *default_files[] = { static int fingerprint_hash = SSH_FP_HASH_DEFAULT; /* Default lifetime (0 == forever) */ -static long lifetime = 0; +static int lifetime = 0; /* User has to confirm key use */ static int confirm = 0; @@ -365,7 +365,7 @@ add_file(int agent_fd, const char *filename, int key_only, int qflag, filename, comment); if (lifetime != 0) { fprintf(stderr, - "Lifetime set to %ld seconds\n", lifetime); + "Lifetime set to %d seconds\n", lifetime); } if (confirm != 0) { fprintf(stderr, "The user must confirm " @@ -420,7 +420,7 @@ add_file(int agent_fd, const char *filename, int key_only, int qflag, fprintf(stderr, "Certificate added: %s (%s)\n", certpath, private->cert->key_id); if (lifetime != 0) { - fprintf(stderr, "Lifetime set to %ld seconds\n", + fprintf(stderr, "Lifetime set to %d seconds\n", lifetime); } if (confirm != 0) { @@ -603,7 +603,7 @@ load_resident_keys(int agent_fd, const char *skprovider, int qflag) sshkey_type(keys[i]), fp); if (lifetime != 0) { fprintf(stderr, - "Lifetime set to %ld seconds\n", lifetime); + "Lifetime set to %d seconds\n", lifetime); } if (confirm != 0) { fprintf(stderr, "The user must confirm " -- cgit v1.2.3-59-g8ed1b