summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2014-12-10 01:24:09 +0000
committerDamien Miller <djm@mindrot.org>2014-12-10 12:21:40 +1100
commit4cf87f4b81fa9380bce5fcff7b0f8382ae3ad996 (patch)
tree42608851e56f46cb650ae180f174dba130760bba
parent4bfad14ca56f8ae04f418997816b4ba84e2cfc3c (diff)
upstream commit
better error value for invalid signature length
-rw-r--r--sshkey.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/sshkey.c b/sshkey.c
index 698173866..cf126626e 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshkey.c,v 1.5 2014/11/18 01:02:25 djm Exp $ */ 1/* $OpenBSD: sshkey.c,v 1.6 2014/12/10 01:24:09 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Alexander von Gernler. All rights reserved. 4 * Copyright (c) 2008 Alexander von Gernler. All rights reserved.
@@ -2124,10 +2124,7 @@ sshkey_verify(const struct sshkey *key,
2124 const u_char *sig, size_t siglen, 2124 const u_char *sig, size_t siglen,
2125 const u_char *data, size_t dlen, u_int compat) 2125 const u_char *data, size_t dlen, u_int compat)
2126{ 2126{
2127 if (siglen == 0) 2127 if (siglen == 0 || dlen > SSH_KEY_MAX_SIGN_DATA_SIZE)
2128 return -1;
2129
2130 if (dlen > SSH_KEY_MAX_SIGN_DATA_SIZE)
2131 return SSH_ERR_INVALID_ARGUMENT; 2128 return SSH_ERR_INVALID_ARGUMENT;
2132 switch (key->type) { 2129 switch (key->type) {
2133#ifdef WITH_OPENSSL 2130#ifdef WITH_OPENSSL