blib/lib/Perlmazing/Perlmazing/aes_decrypt.pm untested

filter: Statementstmt 0.0% 0 / 9 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 14 CC 2 SCAR 15.4
CC
2
Cov
0%
main
6.0
BEGIN
2.0
CRAP 4.7
1 use Perlmazing qw(croak get_aes_cipher);
2  
3 # Mainly ripped from Crypt::Rijndael::MySQL
4 sub main {
5 define my ($data, $key) = (shift, shift);
6 my $cipher = get_aes_cipher $key;
7 my $dec = $cipher->decrypt($data);
8 my $pad = ord substr $dec, -1;
9 croak 'Incorrect padding (wrong password or broken data?)' if substr($dec, -$pad) ne chr($pad) x $pad;
10 substr $dec, 0, length($dec) - $pad;
11 }
12  
13 1;