|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-23 17:53 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 18:00:02 2025 UTC |
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 ) {