diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | authfile.c | 12 |
2 files changed, 12 insertions, 5 deletions
@@ -14,6 +14,11 @@ | |||
14 | [ssh-keysign.c ssh.c] | 14 | [ssh-keysign.c ssh.c] |
15 | enable certificates for hostbased authentication, from Iain Morgan; | 15 | enable certificates for hostbased authentication, from Iain Morgan; |
16 | "looks ok" markus@ | 16 | "looks ok" markus@ |
17 | - djm@cvs.openbsd.org 2010/08/04 05:49:22 | ||
18 | [authfile.c] | ||
19 | commited the wrong version of the hostbased certificate diff; this | ||
20 | version replaces some strlc{py,at} verbosity with xasprintf() at | ||
21 | the request of markus@ | ||
17 | 22 | ||
18 | 20100903 | 23 | 20100903 |
19 | - (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from | 24 | - (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from |
diff --git a/authfile.c b/authfile.c index 6bf41db9a..2bd887845 100644 --- a/authfile.c +++ b/authfile.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: authfile.c,v 1.81 2010/08/04 05:42:47 djm Exp $ */ | 1 | /* $OpenBSD: authfile.c,v 1.82 2010/08/04 05:49:22 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -698,13 +698,15 @@ Key * | |||
698 | key_load_cert(const char *filename) | 698 | key_load_cert(const char *filename) |
699 | { | 699 | { |
700 | Key *pub; | 700 | Key *pub; |
701 | char file[MAXPATHLEN]; | 701 | char *file; |
702 | 702 | ||
703 | pub = key_new(KEY_UNSPEC); | 703 | pub = key_new(KEY_UNSPEC); |
704 | if ((strlcpy(file, filename, sizeof file) < sizeof(file)) && | 704 | xasprintf(&file, "%s-cert.pub", filename); |
705 | (strlcat(file, "-cert.pub", sizeof file) < sizeof(file)) && | 705 | if (key_try_load_public(pub, file, NULL) == 1) { |
706 | (key_try_load_public(pub, file, NULL) == 1)) | 706 | xfree(file); |
707 | return pub; | 707 | return pub; |
708 | } | ||
709 | xfree(file); | ||
708 | key_free(pub); | 710 | key_free(pub); |
709 | return NULL; | 711 | return NULL; |
710 | } | 712 | } |