[openssh-commits] [openssh] 10/12: upstream commit

git+noreply at mindrot.org git+noreply at mindrot.org
Fri Mar 27 12:04:11 AEDT 2015


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

djm pushed a commit to branch master
in repository openssh.

commit f9b78852379b74a2d14e6fc94fe52af30b7e9c31
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Thu Mar 26 07:00:04 2015 +0000

    upstream commit
    
    ban all-zero curve25519 keys as recommended by latest
     CFRG curves draft; ok markus
---
 kexc25519.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/kexc25519.c b/kexc25519.c
index b6e6c40..8d8cd4a 100644
--- a/kexc25519.c
+++ b/kexc25519.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kexc25519.c,v 1.8 2015/01/19 20:16:15 markus Exp $ */
+/* $OpenBSD: kexc25519.c,v 1.9 2015/03/26 07:00:04 djm Exp $ */
 /*
  * Copyright (c) 2001, 2013 Markus Friedl.  All rights reserved.
  * Copyright (c) 2010 Damien Miller.  All rights reserved.
@@ -66,6 +66,11 @@ kexc25519_shared_key(const u_char key[CURVE25519_SIZE],
 	u_char shared_key[CURVE25519_SIZE];
 	int r;
 
+	/* Check for all-zero public key */
+	explicit_bzero(shared_key, CURVE25519_SIZE);
+	if (timingsafe_bcmp(pub, shared_key, CURVE25519_SIZE) == 0)
+		return SSH_ERR_KEY_INVALID_EC_VALUE;
+
 	crypto_scalarmult_curve25519(shared_key, key, pub);
 #ifdef DEBUG_KEXECDH
 	dump_digest("shared secret", shared_key, CURVE25519_SIZE);

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


More information about the openssh-commits mailing list