diff --git a/lib/FusionInventory/Agent/Tools/Generic/License.pm b/lib/FusionInventory/Agent/Tools/Generic/License.pm index 6b7fa60a78..0cbd9fb0f4 100644 --- a/lib/FusionInventory/Agent/Tools/Generic/License.pm +++ b/lib/FusionInventory/Agent/Tools/Generic/License.pm @@ -13,6 +13,33 @@ our @EXPORT = qw( getAdobeLicenses ); +sub _parseAdobeSerial { + my ($raw) = @_; + +# Thanks to Brandon Mulcahy +# http://www.a1vbcode.com/snippet-4796.asp +# http://blog.eka808.com/?p=251 + my $final = ""; + my @subCipherKey = qw/ + 0000000001 5038647192 1456053789 2604371895 + 4753896210 8145962073 0319728564 7901235846 + 7901235846 0319728564 8145962073 4753896210 + 2604371895 1426053789 5038647192 3267408951 + 5038647192 2604371895 8145962073 7901235846 + 3267408951 1426053789 4753896210 0319728564/; + + my $i = 0; + my $ret = ""; + while ($raw =~ s/^(\d)//) { + $subCipherKey[$i++]=~ /^.{$1}(.)/; + $ret .= $1; + } + + $ret =~ s/(\d{4})(\d{4})(\d{4})(\d{4})(\d{4})(\d{4})/$1-$2-$3-$4-$5/; + + return $ret; +} + sub getAdobeLicenses { my (%params) = (@_); @@ -45,7 +72,7 @@ sub getAdobeLicenses { push @licenses, { NAME => $key, FULLNAME => $data{$key}{ALM_LicInfo_EpicAppName}, - KEY => $data{$key}{SN}, + KEY => _parseAdobeSerial($data{$key}{SN}), COMPONENTS => join('/', @{$data{$key}{with}}) } }