Cipher key's size is free (it had to be 16 bytes long) (Lemonldap-512)

This commit is contained in:
François-Xavier Deltombe 2012-11-05 13:36:32 +00:00
parent 3a5b74baa3
commit c7f5aa7fff

View File

@ -11,6 +11,7 @@ package Lemonldap::NG::Common::Crypto;
use strict;
use Crypt::Rijndael;
use MIME::Base64;
use Digest::MD5 qw(md5);
use bytes;
our $VERSION = '1.0.0';
@ -43,7 +44,7 @@ sub _getCipher {
my ( $self, $key ) = @_;
$key ||= "";
$self->{ciphers}->{$key} ||=
Crypt::Rijndael->new( ( $self->{key} ) ^ $key, $self->{mode} );
Crypt::Rijndael->new( md5( $self->{key}, $key ), $self->{mode} );
return $self->{ciphers}->{$key};
}