Skip to content

Commit

Permalink
Silent Crypt::CBC::encode() warning about deprecated opensslv1 PBKDF
Browse files Browse the repository at this point in the history
$ perl -MSession::Storage::Secure -e 'Session::Storage::Secure->new(secret_key=>1)->encode()'
WARNING: The key derivation method "opensslv1" is deprecated. Using -pbkdf=>'pbkdf2' would be better.
Pass -nodeprecate=>1 to inhibit this message.
 at /usr/share/perl5/vendor_perl/Session/Storage/Secure.pm line 213.

New CBC-Encrypt-3.01 defaults to -pbkdf => 'opensslv1' to preserve
compatibility and warns about that at the same time.

This silents the warning until a plan for a migration to the
stronger PBKDF is implemented in Session::Storage::Secure.

<#8>
  • Loading branch information
ppisar committed Mar 16, 2021
1 parent 8b16fba commit e50a4c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Session/Storage/Secure.pm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ sub encode {
my $salt = $self->_irand;
my $key = hmac_sha256( $salt, $self->secret_key );

my $cbc = Crypt::CBC->new( -key => $key, -cipher => 'Rijndael' );
my $cbc = Crypt::CBC->new( -key => $key, -cipher => 'Rijndael', -pbkdf => 'opensslv1', -nodeprecate => 1 );
my ( $ciphertext, $mac );
eval {
$ciphertext = $self->transport_encoder->( $cbc->encrypt( $self->_freeze($data) ) );
Expand Down

0 comments on commit e50a4c0

Please sign in to comment.