summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2010-08-05 13:05:15 +1000
committerDamien Miller <djm@mindrot.org>2010-08-05 13:05:15 +1000
commit5458c4dd138a4ca14ad5d1d1c2da9acff7d909d6 (patch)
tree8bec7cf567e5860a1c751c135ffc94258b00b7f5
parentc158331f8c7e059c6c1d099bffc7f5fc6087ddbd (diff)
- djm@cvs.openbsd.org 2010/08/04 05:49:22
[authfile.c] commited the wrong version of the hostbased certificate diff; this version replaces some strlc{py,at} verbosity with xasprintf() at the request of markus@
-rw-r--r--ChangeLog5
-rw-r--r--authfile.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 7125eaa1..684c5233 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,11 @@
[ssh-keysign.c ssh.c]
enable certificates for hostbased authentication, from Iain Morgan;
"looks ok" markus@
+ - djm@cvs.openbsd.org 2010/08/04 05:49:22
+ [authfile.c]
+ commited the wrong version of the hostbased certificate diff; this
+ version replaces some strlc{py,at} verbosity with xasprintf() at
+ the request of markus@
20100903
- (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from
diff --git a/authfile.c b/authfile.c
index 6bf41db9..2bd88784 100644
--- a/authfile.c
+++ b/authfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: authfile.c,v 1.81 2010/08/04 05:42:47 djm Exp $ */
+/* $OpenBSD: authfile.c,v 1.82 2010/08/04 05:49:22 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -698,13 +698,15 @@ Key *
key_load_cert(const char *filename)
{
Key *pub;
- char file[MAXPATHLEN];
+ char *file;
pub = key_new(KEY_UNSPEC);
- if ((strlcpy(file, filename, sizeof file) < sizeof(file)) &&
- (strlcat(file, "-cert.pub", sizeof file) < sizeof(file)) &&
- (key_try_load_public(pub, file, NULL) == 1))
+ xasprintf(&file, "%s-cert.pub", filename);
+ if (key_try_load_public(pub, file, NULL) == 1) {
+ xfree(file);
return pub;
+ }
+ xfree(file);
key_free(pub);
return NULL;
}