rlauer6 / perl-amazon-s3

A portable client library for working with and managing Amazon S3 buckets and keys.
http://search.cpan.org/dist/Amazon-S3/
2 stars 6 forks source link

missing -key when calling older versions of Crypt::CBC #11

Closed lwaggonerExpedia closed 1 year ago

lwaggonerExpedia commented 1 year ago

https://github.com/rlauer6/perl-amazon-s3/blob/624f4d055693a18c87562a345f75b5c89e284b13/src/main/perl/lib/Amazon/S3.pm.in#L198

First thing I tried to do with this module hit the issue where -key wasn't passed here. I see on https://github.com/rlauer6/perl-amazon-s3/blob/624f4d055693a18c87562a345f75b5c89e284b13/src/main/perl/lib/Amazon/S3.pm.in#L181 it is.

My assumption is both -pass and -key should be provided (one of those is probably backwards compatible?) - Should a fix be put here too? Not sure if something on my system is old or code needs an update?

rlauer6 commented 1 year ago

The newer version of Crypt::CBC uses pass not key but will accept either. I have provided a patch, but if you upgrade your Crypt:::CBC you should be good. Look for version 0.63 on CPAN this morning.

P.S. here is the snippet from Crypt::CBC that indicates that either -pass or -key is acceptable. It appears that at some point the author wanted to disambiguate pass and key but realized that legacy users would still be passing key.

sub _get_key_materials {
    my $self = shift;
    my $options = shift;

    # "key" is a misnomer here, because it is actually usually a passphrase that is used
    # to derive the true key
    my $pass = $options->{pass} || $options->{key};