summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2002-03-27 17:38:43 +0000
committerBen Lindstrom <mouring@eviladmin.org>2002-03-27 17:38:43 +0000
commite1f9e324e975af50e44ab373e3fa3b1104ffb30f (patch)
tree6a59f751176ea21962d6cfe243b1f3894cb8e191
parent57686a82a5a055f53f3ae351bce21a7a93d38304 (diff)
- markus@cvs.openbsd.org 2002/03/26 23:13:03
[auth-rsa.c] disallow RSA keys < 768 for protocol 1, too (rhosts-rsa and rsa auth)
-rw-r--r--ChangeLog5
-rw-r--r--auth-rsa.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 46b6d0f48..3bf991d65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -17,6 +17,9 @@
17 - markus@cvs.openbsd.org 2002/03/26 22:50:39 17 - markus@cvs.openbsd.org 2002/03/26 22:50:39
18 [channels.h] 18 [channels.h]
19 CHANNEL_EFD_OUTPUT_ACTIVE is false for CHAN_CLOSE_RCVD, too 19 CHANNEL_EFD_OUTPUT_ACTIVE is false for CHAN_CLOSE_RCVD, too
20 - markus@cvs.openbsd.org 2002/03/26 23:13:03
21 [auth-rsa.c]
22 disallow RSA keys < 768 for protocol 1, too (rhosts-rsa and rsa auth)
20 23
2120020325 2420020325
22 - (stevesk) import OpenBSD <sys/tree.h> as "openbsd-compat/tree.h" 25 - (stevesk) import OpenBSD <sys/tree.h> as "openbsd-compat/tree.h"
@@ -8080,4 +8083,4 @@
8080 - Wrote replacements for strlcpy and mkdtemp 8083 - Wrote replacements for strlcpy and mkdtemp
8081 - Released 1.0pre1 8084 - Released 1.0pre1
8082 8085
8083$Id: ChangeLog,v 1.1998 2002/03/27 17:36:41 mouring Exp $ 8086$Id: ChangeLog,v 1.1999 2002/03/27 17:38:43 mouring Exp $
diff --git a/auth-rsa.c b/auth-rsa.c
index c51400c2a..5b98f2cf2 100644
--- a/auth-rsa.c
+++ b/auth-rsa.c
@@ -14,7 +14,7 @@
14 */ 14 */
15 15
16#include "includes.h" 16#include "includes.h"
17RCSID("$OpenBSD: auth-rsa.c,v 1.53 2002/03/25 09:21:13 markus Exp $"); 17RCSID("$OpenBSD: auth-rsa.c,v 1.54 2002/03/26 23:13:03 markus Exp $");
18 18
19#include <openssl/rsa.h> 19#include <openssl/rsa.h>
20#include <openssl/md5.h> 20#include <openssl/md5.h>
@@ -78,6 +78,13 @@ auth_rsa_verify_response(Key *key, BIGNUM *challenge, u_char response[16])
78 MD5_CTX md; 78 MD5_CTX md;
79 int len; 79 int len;
80 80
81 /* don't allow short keys */
82 if (BN_num_bits(key->rsa->n) < 768) {
83 error("auth_rsa_verify_response: n too small: %d bits",
84 BN_num_bits(key->rsa->n));
85 return (0);
86 }
87
81 /* The response is MD5 of decrypted challenge plus session id. */ 88 /* The response is MD5 of decrypted challenge plus session id. */
82 len = BN_num_bytes(challenge); 89 len = BN_num_bytes(challenge);
83 if (len <= 0 || len > 32) 90 if (len <= 0 || len > 32)