1
0
mirror of https://github.com/Yubico/yubikey-ksm.git synced 2025-03-23 18:19:51 +01:00

Renamed hex2bin to yubi_hex2bin.

This commit is contained in:
Dain Nilsson 2013-01-23 16:03:34 +01:00
parent e45bc5f088
commit deb4070f4e
2 changed files with 8 additions and 4 deletions

4
NEWS
View File

@ -1,5 +1,9 @@
* Version 1.9 unreleased
* Renamed hex2bin to yubi_hex2bin.
Issue #1 reported by Dain Nilsson, see:
https://github.com/Yubico/yubikey-ksm/issues/1
* Version 1.8 released 2013-01-21
* Added ChangeLog to releases.

View File

@ -28,7 +28,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
function hex2bin($h)
function yubi_hex2bin($h)
{
if (!is_string($h)) return null;
$r='';
@ -46,9 +46,9 @@ function modhex2hex($m)
function aes128ecb_decrypt($key,$in)
{
$td = mcrypt_module_open(MCRYPT_RIJNDAEL_128, '', 'ecb', '');
$iv = hex2bin('00000000000000000000000000000000');
mcrypt_generic_init($td, hex2bin($key), $iv);
$result = bin2hex(mdecrypt_generic($td, hex2bin($in)));
$iv = yubi_hex2bin('00000000000000000000000000000000');
mcrypt_generic_init($td, yubi_hex2bin($key), $iv);
$result = bin2hex(mdecrypt_generic($td, yubi_hex2bin($in)));
mcrypt_generic_deinit($td);
return $result;