diff options
-rw-r--r-- | ssh-dss.c | 5 | ||||
-rw-r--r-- | ssh-ecdsa.c | 5 | ||||
-rw-r--r-- | ssh-ed25519.c | 5 | ||||
-rw-r--r-- | ssh-rsa.c | 5 |
4 files changed, 12 insertions, 8 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-dss.c,v 1.34 2015/12/11 04:21:12 mmcc Exp $ */ | 1 | /* $OpenBSD: ssh-dss.c,v 1.35 2016/04/21 06:08:02 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * | 4 | * |
@@ -139,7 +139,8 @@ ssh_dss_verify(const struct sshkey *key, | |||
139 | char *ktype = NULL; | 139 | char *ktype = NULL; |
140 | 140 | ||
141 | if (key == NULL || key->dsa == NULL || | 141 | if (key == NULL || key->dsa == NULL || |
142 | sshkey_type_plain(key->type) != KEY_DSA) | 142 | sshkey_type_plain(key->type) != KEY_DSA || |
143 | signature == NULL || signaturelen == 0) | ||
143 | return SSH_ERR_INVALID_ARGUMENT; | 144 | return SSH_ERR_INVALID_ARGUMENT; |
144 | if (dlen == 0) | 145 | if (dlen == 0) |
145 | return SSH_ERR_INTERNAL_ERROR; | 146 | return SSH_ERR_INTERNAL_ERROR; |
diff --git a/ssh-ecdsa.c b/ssh-ecdsa.c index 74912dfd9..d7bf3c69b 100644 --- a/ssh-ecdsa.c +++ b/ssh-ecdsa.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-ecdsa.c,v 1.12 2015/12/11 04:21:12 mmcc Exp $ */ | 1 | /* $OpenBSD: ssh-ecdsa.c,v 1.13 2016/04/21 06:08:02 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 3 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
4 | * Copyright (c) 2010 Damien Miller. All rights reserved. | 4 | * Copyright (c) 2010 Damien Miller. All rights reserved. |
@@ -121,7 +121,8 @@ ssh_ecdsa_verify(const struct sshkey *key, | |||
121 | char *ktype = NULL; | 121 | char *ktype = NULL; |
122 | 122 | ||
123 | if (key == NULL || key->ecdsa == NULL || | 123 | if (key == NULL || key->ecdsa == NULL || |
124 | sshkey_type_plain(key->type) != KEY_ECDSA) | 124 | sshkey_type_plain(key->type) != KEY_ECDSA || |
125 | signature == NULL || signaturelen == 0) | ||
125 | return SSH_ERR_INVALID_ARGUMENT; | 126 | return SSH_ERR_INVALID_ARGUMENT; |
126 | 127 | ||
127 | if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 || | 128 | if ((hash_alg = sshkey_ec_nid_to_hash_alg(key->ecdsa_nid)) == -1 || |
diff --git a/ssh-ed25519.c b/ssh-ed25519.c index b159ff5ee..5163e0297 100644 --- a/ssh-ed25519.c +++ b/ssh-ed25519.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-ed25519.c,v 1.6 2015/01/15 21:38:50 markus Exp $ */ | 1 | /* $OpenBSD: ssh-ed25519.c,v 1.7 2016/04/21 06:08:02 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2013 Markus Friedl <markus@openbsd.org> | 3 | * Copyright (c) 2013 Markus Friedl <markus@openbsd.org> |
4 | * | 4 | * |
@@ -107,7 +107,8 @@ ssh_ed25519_verify(const struct sshkey *key, | |||
107 | if (key == NULL || | 107 | if (key == NULL || |
108 | sshkey_type_plain(key->type) != KEY_ED25519 || | 108 | sshkey_type_plain(key->type) != KEY_ED25519 || |
109 | key->ed25519_pk == NULL || | 109 | key->ed25519_pk == NULL || |
110 | datalen >= INT_MAX - crypto_sign_ed25519_BYTES) | 110 | datalen >= INT_MAX - crypto_sign_ed25519_BYTES || |
111 | signature == NULL || signaturelen == 0) | ||
111 | return SSH_ERR_INVALID_ARGUMENT; | 112 | return SSH_ERR_INVALID_ARGUMENT; |
112 | 113 | ||
113 | if ((b = sshbuf_from(signature, signaturelen)) == NULL) | 114 | if ((b = sshbuf_from(signature, signaturelen)) == NULL) |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-rsa.c,v 1.58 2015/12/11 04:21:12 mmcc Exp $ */ | 1 | /* $OpenBSD: ssh-rsa.c,v 1.59 2016/04/21 06:08:02 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> | 3 | * Copyright (c) 2000, 2003 Markus Friedl <markus@openbsd.org> |
4 | * | 4 | * |
@@ -172,7 +172,8 @@ ssh_rsa_verify(const struct sshkey *key, | |||
172 | 172 | ||
173 | if (key == NULL || key->rsa == NULL || | 173 | if (key == NULL || key->rsa == NULL || |
174 | sshkey_type_plain(key->type) != KEY_RSA || | 174 | sshkey_type_plain(key->type) != KEY_RSA || |
175 | BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE) | 175 | BN_num_bits(key->rsa->n) < SSH_RSA_MINIMUM_MODULUS_SIZE || |
176 | sig == NULL || siglen == 0) | ||
176 | return SSH_ERR_INVALID_ARGUMENT; | 177 | return SSH_ERR_INVALID_ARGUMENT; |
177 | 178 | ||
178 | if ((b = sshbuf_from(sig, siglen)) == NULL) | 179 | if ((b = sshbuf_from(sig, siglen)) == NULL) |