phpseclib/phpseclib — pull request #33 by slowbro (2012-11-14 17:00:03+00:00)
Title: Fix #30: Crypt_DES NOFB Padding issue

Fix Crypt_DES::_pad() and _unpad() ignoring Crypt_DES::$paddable

Unit tests show this does not affect Crypt_DES under all other modes.

[slowbro@las01-22-katelyn phpseclib]$ phpunit tests/Crypt/DES/DESTest.php
PHPUnit 3.6.12 by Sebastian Bergmann.

Configuration read from /home/slowbro/projects/phpseclib/phpunit.xml.dist

.Test Crypt_DES with MODE_ECB, key 'thisisakey', password not set.
Test Crypt_DES with MODE_CBC, key 'thisisakey', password not set.
Test Crypt_DES with MODE_CTR, key 'thisisakey', password not set.
Test Crypt_DES with MODE_OFB, key 'thisisakey', password not set.
Test Crypt_DES with MODE_CFB, key 'thisisakey', password not set.
.Test Crypt_DES with MODE_ECB, key not set, password 'supersecure'.
Test Crypt_DES with MODE_CBC, key not set, password 'supersecure'.
Test Crypt_DES with MODE_CTR, key not set, password 'supersecure'.
Test Crypt_DES with MODE_OFB, key not set, password 'supersecure'.
Test Crypt_DES with MODE_CFB, key not set, password 'supersecure'.

Time: 1 second, Memory: 3.75Mb

OK (2 tests, 10 assertions)