Skip to content

Non-security digest.Digest use cleanups#2410

Merged
giuseppe merged 7 commits intocontainers:mainfrom
mtrmac:digest-nonsecurity
May 14, 2024
Merged

Non-security digest.Digest use cleanups#2410
giuseppe merged 7 commits intocontainers:mainfrom
mtrmac:digest-nonsecurity

Conversation

@mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented May 9, 2024

A set of cleanups around creating/validating digest.Digest values, in places where it should not be exploitable.

See individual commit messages for details.

A side effect of the code audit required by CVE-2024-3727 .

@rhatdan
Copy link
Member

rhatdan commented May 13, 2024

LGTM
@giuseppe @Luap99 @mheon @baude PTAL

mtrmac added 7 commits May 14, 2024 01:01
Should not actually change behavior, the value is never set.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
These cases should be safe because the data is either trusted
(ostree), or validated by an exact match later (signatures)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
... so that we can simplify the error handling paths.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Use the ordinary digest.Parse() instead of separate digest.Validate() and conversions.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
@mtrmac mtrmac force-pushed the digest-nonsecurity branch from 1944cce to 496e3af Compare May 13, 2024 23:02
Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@giuseppe giuseppe merged commit 5710389 into containers:main May 14, 2024
@mtrmac mtrmac deleted the digest-nonsecurity branch May 14, 2024 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants