[openssh-commits] [openssh] 01/02: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Wed May 10 11:41:33 AEST 2017


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 5f02bb1f99f70bb422be8a5c2b77ef853f1db554
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Mon May 8 06:11:06 2017 +0000

    upstream commit
    
    make requesting bad ECDSA bits yield the same error
    (SSH_ERR_KEY_LENGTH) as the same mistake for RSA/DSA
    
    Upstream-ID: bf40d3fee567c271e33f05ef8e4e0fa0b6f0ece6
---
 sshkey.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/sshkey.c b/sshkey.c
index 6518c6f0..f9518bd7 100644
--- a/sshkey.c
+++ b/sshkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshkey.c,v 1.49 2017/05/07 23:15:59 djm Exp $ */
+/* $OpenBSD: sshkey.c,v 1.50 2017/05/08 06:11:06 djm Exp $ */
 /*
  * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  * Copyright (c) 2008 Alexander von Gernler.  All rights reserved.
@@ -1504,9 +1504,10 @@ ecdsa_generate_private_key(u_int bits, int *nid, EC_KEY **ecdsap)
 	EC_KEY *private;
 	int ret = SSH_ERR_INTERNAL_ERROR;
 
-	if (nid == NULL || ecdsap == NULL ||
-	    (*nid = sshkey_ecdsa_bits_to_nid(bits)) == -1)
+	if (nid == NULL || ecdsap == NULL)
 		return SSH_ERR_INVALID_ARGUMENT;
+	if ((*nid = sshkey_ecdsa_bits_to_nid(bits)) == -1)
+		return SSH_ERR_KEY_LENGTH;
 	*ecdsap = NULL;
 	if ((private = EC_KEY_new_by_curve_name(*nid)) == NULL) {
 		ret = SSH_ERR_ALLOC_FAIL;

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list