Bug 2235322

Summary: perl-Crypt-CBC-3.04 of RHEL9 can not decrypt ciphertext created with 'header' => 'randomiv'
Product: [Fedora] Fedora EPEL Reporter: Paulo Andrade <pandrade>
Component: perl-Crypt-CBCAssignee: Paul Howarth <paul>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: epel9CC: andreas, paul, perl-devel
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: perl-Crypt-CBC-3.04-13.el9 perl-Crypt-CBC-3.04-13.fc37 perl-Crypt-CBC-3.04-13.fc38 perl-Crypt-CBC-3.04-13.fc39 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-14 00:31:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
randomiv.patch
none
cbctest1.pl none

Description Paulo Andrade 2023-08-28 12:38:10 UTC
Created attachment 1985651 [details]
randomiv.patch

The function sub key_and_iv () in the module Crypt/CBC/PBKDF.pm (part of the perl-Crypt-CBC-3.04-1.el9.noarch) looks like this:

sub key_and_iv {
...
    my $key  = substr($hash,0,$self->{key_len});
    my $iv   = substr($hash,$self->{key_len},$self->{iv_len});
    return ($key,$iv);
}

This function returns the extracted key as first value and the suggested patch fills this first value into the $self->{key}.

Comment 1 Paulo Andrade 2023-08-28 12:41:39 UTC
Created attachment 1985652 [details]
cbctest1.pl

Sample reproducer of the issue.

With the patch it should print:

original: Testtext
encoded:  52616e646f6d49567f45745b8958233779a2e788e8174e4ab4cdaf2c60ea04bd
decoded:  Testtext

without the patch, as is currently, it will print something like:

decoded:  �(��([f

Comment 2 Fedora Update System 2023-09-05 11:23:01 UTC
FEDORA-2023-861929b0c4 has been submitted as an update to Fedora 38. https://bodhi.fedoraproject.org/updates/FEDORA-2023-861929b0c4

Comment 3 Fedora Update System 2023-09-05 11:23:01 UTC
FEDORA-2023-706d9982c4 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-706d9982c4

Comment 4 Fedora Update System 2023-09-05 11:23:02 UTC
FEDORA-2023-a987ae65e7 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-a987ae65e7

Comment 5 Fedora Update System 2023-09-06 00:23:34 UTC
FEDORA-EPEL-2023-2af18ec68f has been pushed to the Fedora EPEL 9 testing repository.

You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-EPEL-2023-2af18ec68f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2023-09-06 01:23:58 UTC
FEDORA-2023-861929b0c4 has been pushed to the Fedora 38 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-861929b0c4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-861929b0c4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2023-09-06 01:32:40 UTC
FEDORA-2023-a987ae65e7 has been pushed to the Fedora 39 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-a987ae65e7`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-a987ae65e7

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2023-09-06 02:15:30 UTC
FEDORA-2023-706d9982c4 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-706d9982c4`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-706d9982c4

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2023-09-14 00:31:56 UTC
FEDORA-EPEL-2023-2af18ec68f has been pushed to the Fedora EPEL 9 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2023-09-14 00:43:03 UTC
FEDORA-2023-706d9982c4 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2023-09-14 01:27:39 UTC
FEDORA-2023-861929b0c4 has been pushed to the Fedora 38 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 12 Fedora Update System 2023-09-15 18:49:12 UTC
FEDORA-2023-a987ae65e7 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.