#37564 [Opn->Csd]: php-snmp with AES is broken
| From: | sniper@php.net | Date: | Wed, 26 Jul 2006 23:57:58 +0000 |
| Subject: | #37564 [Opn->Csd]: php-snmp with AES is broken | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99960@lists.php.net to get a copy of this message | ||
ID: 37564
Updated by: sniper@php.net
Reported By: scott dot moynes+php at gmail dot com
-Status: Open
+Status: Closed
Bug Type: SNMP related
PHP Version: 5.1.4
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-05-24 18:55:59] scott dot moynes+php at gmail dot com
I cannot confirm without compiling and my employer is not paying me to
do that.
However, I do not think so. The patch only modifies the code within the
#ifdef SNMP_VALIDATE_ERROR block and that macro was introduced in
net-snmp 5.2; the #else block for net-snmp < 5.2 remains unchanged. By
inspection of the source code of net-snmp 5.1, I have ensured that the
OIDSIZE macro is appropriate for those releases, ie.
usmAES128PrivProtocol is an array of oid values.
I have not confirmed that it does not create a compatibility problem
for ucd-snmp, but I do not think so because it does not support AES and
so the HAVE_AES macro will not be set.
So, by exhaustion of cases, I believe this patch does not break
compatibility.
------------------------------------------------------------------------
[2006-05-24 17:38:30] tony2001@php.net
From what I can see with this patch you're breaking support of SNMP <
5.2. Am I right?
------------------------------------------------------------------------
[2006-05-24 14:15:17] scott dot moynes+php at gmail dot com
diff -ru php-5.1.4/ext/snmp/snmp.c php-5.1.4-cbn/ext/snmp/snmp.c
--- php-5.1.4/ext/snmp/snmp.c 2006-01-01 07:50:13.000000000 -0500
+++ php-5.1.4-cbn/ext/snmp/snmp.c 2006-05-24 10:12:40.000000000
-0400
@@ -831,10 +831,13 @@
*
* As we want this extension to compile on both versions, we use the
latter
* symbol on purpose, as it's defined to be the same as the former.
+*
+* However, in 5.2 the type of usmAES128PrivProtocol is a pointer, not
an
+* array, so we cannot use the OIDSIZE macro because it uses sizeof().
*/
|| !strcasecmp(prot, "AES")) {
s->securityPrivProto = usmAES128PrivProtocol;
- s->securityPrivProtoLen =
OIDSIZE(usmAES128PrivProtocol);
+ s->securityPrivProtoLen =
USM_PRIV_PROTO_AES128_LEN;
return (0);
#else
) {
------------------------------------------------------------------------
[2006-05-24 06:41:50] tony2001@php.net
We would appreciate a patch in unified diff format.
------------------------------------------------------------------------
[2006-05-23 18:10:22] scott dot moynes+php at gmail dot com
In snmp.c, one cannot use the OIDSIZE macro for the
usmAES128PrivProtocol symbol because it is defined as a oid pointer to
usmAESPrivProtocol, not an oid array.
The fix is to change all OIDSIZE(usmAES128PrivProtocol) expressions to
USM_PRIV_PROTO_AES_LEN.
This is with net-snmp; not sure about ucd-snmp.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/37564
--
Edit this bug report at http://bugs.php.net/?id=37564&edit=1