From 309f3d1d9c6a8f480de33a21f61809c14da97bdd Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Thu, 20 Sep 2001 00:55:53 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2001/09/19 13:23:29 [key.c] key_read() now returns -1 on type mismatch, too --- ChangeLog | 5 ++++- key.c | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8db432f7..ad4084955 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ - markus@cvs.openbsd.org 2001/09/19 10:08:51 [sshd.8] command=xxx applies to subsystem now, too + - markus@cvs.openbsd.org 2001/09/19 13:23:29 + [key.c] + key_read() now returns -1 on type mismatch, too 20010918 - (djm) Configure support for smartcards. Based on Ben's work. @@ -6510,4 +6513,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1542 2001/09/20 00:54:01 mouring Exp $ +$Id: ChangeLog,v 1.1543 2001/09/20 00:55:53 mouring Exp $ diff --git a/key.c b/key.c index b382f36cf..5c711b9d7 100644 --- a/key.c +++ b/key.c @@ -32,7 +32,7 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "includes.h" -RCSID("$OpenBSD: key.c,v 1.31 2001/09/17 20:50:22 markus Exp $"); +RCSID("$OpenBSD: key.c,v 1.32 2001/09/19 13:23:29 markus Exp $"); #include @@ -358,7 +358,7 @@ write_bignum(FILE *f, BIGNUM *num) return 1; } -/* returns 1 ok, -1 error, 0 type mismatch */ +/* returns 1 ok, -1 error */ int key_read(Key *ret, char **cpp) { @@ -413,7 +413,7 @@ key_read(Key *ret, char **cpp) } else if (ret->type != type) { /* is a key, but different type */ debug3("key_read: type mismatch"); - return 0; + return -1; } len = 2*strlen(cp); blob = xmalloc(len);