diff options
author | Damien Miller <djm@mindrot.org> | 2014-02-28 10:00:27 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-02-28 10:00:27 +1100 |
commit | f9a9aaba437c2787e40cf7cc928281950e161678 (patch) | |
tree | 862b9afbe79f83d23eaa5fc101a681b1f96fc90d | |
parent | fb3423b612713d9cde67c8a75f6f51188d6a3de3 (diff) |
- djm@cvs.openbsd.org 2014/02/27 00:41:49
[bufbn.c]
fix unsigned overflow that could lead to reading a short ssh protocol
1 bignum value; found by Ben Hawkes; ok deraadt@
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | bufbn.c | 7 |
2 files changed, 13 insertions, 1 deletions
@@ -1,3 +1,10 @@ | |||
1 | 20140228 | ||
2 | - OpenBSD CVS Sync | ||
3 | - djm@cvs.openbsd.org 2014/02/27 00:41:49 | ||
4 | [bufbn.c] | ||
5 | fix unsigned overflow that could lead to reading a short ssh protocol | ||
6 | 1 bignum value; found by Ben Hawkes; ok deraadt@ | ||
7 | |||
1 | 20140227 | 8 | 20140227 |
2 | - OpenBSD CVS Sync | 9 | - OpenBSD CVS Sync |
3 | - djm@cvs.openbsd.org 2014/02/26 20:18:37 | 10 | - djm@cvs.openbsd.org 2014/02/26 20:18:37 |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bufbn.c,v 1.9 2014/02/02 03:44:31 djm Exp $*/ | 1 | /* $OpenBSD: bufbn.c,v 1.10 2014/02/27 00:41:49 djm Exp $*/ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -108,6 +108,11 @@ buffer_get_bignum_ret(Buffer *buffer, BIGNUM *value) | |||
108 | return (-1); | 108 | return (-1); |
109 | } | 109 | } |
110 | bits = get_u16(buf); | 110 | bits = get_u16(buf); |
111 | if (bits > 65536-7) { | ||
112 | error("buffer_get_bignum_ret: cannot handle BN of size %d", | ||
113 | bits); | ||
114 | return (-1); | ||
115 | } | ||
111 | /* Compute the number of binary bytes that follow. */ | 116 | /* Compute the number of binary bytes that follow. */ |
112 | bytes = (bits + 7) / 8; | 117 | bytes = (bits + 7) / 8; |
113 | if (bytes > 8 * 1024) { | 118 | if (bytes > 8 * 1024) { |