summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorDamien Miller <djm@cvs.openbsd.org>2014-12-10 01:24:10 +0000
committerDamien Miller <djm@cvs.openbsd.org>2014-12-10 01:24:10 +0000
commit598757624e1af81825ada1401cc3df0d5bb1a43f (patch)
treecfc167c3a1ff01a508e61759fdf09248775453bd /usr.bin
parentd7c702156bfce1dde4eb314f56e08769dc8f7aea (diff)
better error value for invalid signature length
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ssh/sshkey.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/usr.bin/ssh/sshkey.c b/usr.bin/ssh/sshkey.c
index f0540db1f35..87c9498cfcd 100644
--- a/usr.bin/ssh/sshkey.c
+++ b/usr.bin/ssh/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.5 2014/11/18 01:02:25 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.6 2014/12/10 01:24:09 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -2084,10 +2084,7 @@ sshkey_verify(const struct sshkey *key,
const u_char *sig, size_t siglen,
const u_char *data, size_t dlen, u_int compat)
{
- if (siglen == 0)
- return -1;
-
- if (dlen > SSH_KEY_MAX_SIGN_DATA_SIZE)
+ if (siglen == 0 || dlen > SSH_KEY_MAX_SIGN_DATA_SIZE)
return SSH_ERR_INVALID_ARGUMENT;
switch (key->type) {
#ifdef WITH_OPENSSL