SNMP icon indicating copy to clipboard operation
SNMP copied to clipboard

Privacy mechanism 'des' causing exception with PHP 8.3

Open dkatrig opened this issue 1 year ago • 1 comments

Using this package with PHP 8.3 I was trapped in an exception caused by a call of openssl_encrypt in the PrivacyTrait.php module. The message was 'Unable to encrypt the scopedPdu using des'.

It took a while to figure out that the cipher algorithm alias that was passed is actually 'des-cbc', defined in DESPrivacyModule.php. The opensll extension of PHP 8.3 doesn't know this anymore. I checked this by calling openssl_get_cipher_methods. All available algorithms with 'des' are shown in this pic:

des

Replacing the alias with each of these available ciphers led to a success using 'des-ede3-cbc' instead of 'des-cbc'. This was successfully tested with several printers using SNMP v3 and DES as privacy protocol.

I suppose to change that. Kind regards, Georg

dkatrig avatar Dec 05 '24 11:12 dkatrig

Thank you for reporting this! I'll look into updating this for newer versions.

ChadSikorra avatar Dec 07 '24 01:12 ChadSikorra