- 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@
This commit is contained in:
parent
c158331f8c
commit
5458c4dd13
|
@ -14,6 +14,11 @@
|
||||||
[ssh-keysign.c ssh.c]
|
[ssh-keysign.c ssh.c]
|
||||||
enable certificates for hostbased authentication, from Iain Morgan;
|
enable certificates for hostbased authentication, from Iain Morgan;
|
||||||
"looks ok" markus@
|
"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
|
20100903
|
||||||
- (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from
|
- (dtucker) [monitor.c] Bug #1795: Initialize the values to be returned from
|
||||||
|
|
12
authfile.c
12
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>
|
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||||
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
|
||||||
|
@ -698,13 +698,15 @@ Key *
|
||||||
key_load_cert(const char *filename)
|
key_load_cert(const char *filename)
|
||||||
{
|
{
|
||||||
Key *pub;
|
Key *pub;
|
||||||
char file[MAXPATHLEN];
|
char *file;
|
||||||
|
|
||||||
pub = key_new(KEY_UNSPEC);
|
pub = key_new(KEY_UNSPEC);
|
||||||
if ((strlcpy(file, filename, sizeof file) < sizeof(file)) &&
|
xasprintf(&file, "%s-cert.pub", filename);
|
||||||
(strlcat(file, "-cert.pub", sizeof file) < sizeof(file)) &&
|
if (key_try_load_public(pub, file, NULL) == 1) {
|
||||||
(key_try_load_public(pub, file, NULL) == 1))
|
xfree(file);
|
||||||
return pub;
|
return pub;
|
||||||
|
}
|
||||||
|
xfree(file);
|
||||||
key_free(pub);
|
key_free(pub);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue