Skip Menu |

This queue is for tickets about the Net-iTMS CPAN distribution.

Maintainer(s)' notes

Net::iTMS is currently unmaintained and probably broken. That said, bug reports are still welcome since in case it is ever revived they'll provide a place to start.

Report information
The Basics
Id: 19826
Status: rejected
Priority: 0/
Queue: Net-iTMS

People
Owner: Nobody in particular
Requestors: TOMI [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: (no value)
Fixed in: (no value)



Subject: Store might not send a x-apple-crypto-iv header
Without the x-apple-crypto-iv header, Crypt::Rijndael gets upset at init time, because there's no iv. Attached patch only initializes it if there is such a header. This isn't quite correct - forcing decrypt will still fail of there isn't a header, but at least the simple case actually works for me now.
Subject: Net-iTMS.patch
diff -ru Net-iTMS-0.15/lib/Net/iTMS/Request.pm Net-iTMS-0.15-tomi/lib/Net/iTMS/Request.pm --- Net-iTMS-0.15/lib/Net/iTMS/Request.pm 2005-03-29 15:48:07.000000000 +0100 +++ Net-iTMS-0.15-tomi/lib/Net/iTMS/Request.pm 2006-06-11 17:05:33.000000000 +0100 @@ -192,21 +192,6 @@ if ($opt->{decrypt}) { $self->_debug('Decrypting content...'); - # Since the key is static, we can just hard-code it here - my $iTunesKey = pack 'H*', '8a9dad399fb014c131be611820d78895'; - - # - # Create the AES CBC decryption object using the iTunes key and the - # initialization vector (x-apple-crypto-iv) - # - my $cbc = Crypt::CBC->new({ - key => $iTunesKey, - cipher => 'Rijndael', - iv => pack ('H*', $res->header('x-apple-crypto-iv')), - regenerate_key => 0, - padding => 'standard', - prepend_iv => 0, - }); # Try to intelligently determine whether content is actually # encrypted. If it isn't, skip the decryption unless the caller @@ -215,6 +200,23 @@ my $decrypted; if ($opt->{decrypt} == 2 or $res->header('x-apple-crypto-iv')) { + + # Since the key is static, we can just hard-code it here + my $iTunesKey = pack 'H*', '8a9dad399fb014c131be611820d78895'; + + # + # Create the AES CBC decryption object using the iTunes key and the + # initialization vector (x-apple-crypto-iv) + # + my $cbc = Crypt::CBC->new({ + key => $iTunesKey, + cipher => 'Rijndael', + iv => pack ('H*', $res->header('x-apple-crypto-iv')), + regenerate_key => 0, + padding => 'standard', + prepend_iv => 0, + }); + $decrypted = $cbc->decrypt($res->content); } else { $self->_debug(' Content looks unencrypted... skipping decryption');
(Going through old tickets -- I abandoned this distribution a while ago.) On Sun Jun 11 12:10:21 2006, TOMI wrote: Show quoted text
> Without the x-apple-crypto-iv header, Crypt::Rijndael gets upset at init > time, because there's no iv. Attached patch only initializes it if there > is such a header. This isn't quite correct - forcing decrypt will still > fail of there isn't a header, but at least the simple case actually > works for me now.