changeset 2484:da947b293f1b

* src/scapi.c: Fix CVE-2008-0960 (CERT/CC VU#481564).
author jlarmour
date Wed, 11 Jun 2008 13:14:09 +0000
parents 3071a60a92da
children 0e9d1d1df4a0
files packages/net/snmp/lib/current/ChangeLog packages/net/snmp/lib/current/src/scapi.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/packages/net/snmp/lib/current/ChangeLog
+++ b/packages/net/snmp/lib/current/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-11  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* src/scapi.c: Fix CVE-2008-0960 (CERT/CC VU#481564).
+
 2006-07-27  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* include/config.h (HAVE_GETTIMEOFDAY): Add missing hash (reported
--- a/packages/net/snmp/lib/current/src/scapi.c
+++ b/packages/net/snmp/lib/current/src/scapi.c
@@ -521,6 +521,10 @@ sc_check_keyed_hash(	oid	*authtype,	size
 	}
 
 
+        if (maclen != USM_MD5_AND_SHA_AUTH_LEN) {
+            QUITFUN(SNMPERR_GENERR, sc_check_keyed_hash_quit);
+        }
+
 	/* 
 	 * Generate a full hash of the message, then compare
 	 * the result with the given MAC which may shorter than