ID:          37564
 Updated by:  [EMAIL PROTECTED]
 Reported By: scott dot moynes+php at gmail dot com
-Status:      Open
+Status:      Feedback
 Bug Type:    SNMP related
 PHP Version: 5.1.4
 New Comment:

>From what I can see with this patch you're breaking support of SNMP <
5.2. Am I right?


Previous Comments:
------------------------------------------------------------------------

[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] [EMAIL PROTECTED]

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.

------------------------------------------------------------------------

[2006-05-23 17:53:18] scott dot moynes+php at gmail dot com

Description:
------------
A bug in the source of php-snmp causes use of AES privacy encryption
impossible.

Reproduce code:
---------------
//Assuming snmpd is configured appropriately for the user

$result = snmp3_walk("localhost", "user", "authPriv", "sha",
"passphrase", "AES", "passphrase",  "system", 1000000, 10);
print_r($result);

Expected result:
----------------
//The output of the system OID
Array
(
  [0] => STRING: Linux smoynes 2.6.11.4-21.10-smp #1 SMP Tue Nov 29
14:32:49 UTC 2005 i686
...
)


Actual result:
--------------
PHP Warning:  %v%v(): An error occurred, quitting in aes_test.php on
line 3



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=37564&edit=1

Reply via email to