diff options
author | 2010-08-04 05:49:22 +0000 | |
---|---|---|
committer | 2010-08-04 05:49:22 +0000 | |
commit | 7082ed34a7bb8c3df4777e9b2065ab161b4666e7 (patch) | |
tree | 183e41f9e0f078afc5783810a9c48c8cced77863 | |
parent | enable certificates for hostbased authentication, from Iain Morgan; (diff) | |
download | wireguard-openbsd-7082ed34a7bb8c3df4777e9b2065ab161b4666e7.tar.xz wireguard-openbsd-7082ed34a7bb8c3df4777e9b2065ab161b4666e7.zip |
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-- | usr.bin/ssh/authfile.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.bin/ssh/authfile.c b/usr.bin/ssh/authfile.c index ffc21005c0c..90271c31860 100644 --- a/usr.bin/ssh/authfile.c +++ b/usr.bin/ssh/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 @@ -686,13 +686,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; } |