fix: support multiple letters in openssl patch version (#4106)

Signed-off-by: honigbot <thesoftbear@gmail.com>
This commit is contained in:
honigbot 2025-08-12 16:30:41 +02:00 committed by GitHub
parent 9f956dca8f
commit 80e61175ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 1 deletions

View File

@ -1183,6 +1183,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("openssl-binary"), Metadata: metadata("openssl-binary"),
}, },
}, },
{
logicalFixture: "openssl/1.1.1zb/linux-arm64",
expected: pkg.Package{
Name: "openssl",
Version: "1.1.1zb",
Type: "binary",
PURL: "pkg:generic/openssl@1.1.1zb",
Locations: locations("openssl"),
Metadata: metadata("openssl-binary"),
},
},
{ {
logicalFixture: "gcc/12.3.0/linux-amd64", logicalFixture: "gcc/12.3.0/linux-amd64",
expected: pkg.Package{ expected: pkg.Package{

View File

@ -493,7 +493,7 @@ func DefaultClassifiers() []binutils.Classifier {
EvidenceMatcher: m.FileContentsVersionMatcher( EvidenceMatcher: m.FileContentsVersionMatcher(
// [NUL]OpenSSL 3.1.4' // [NUL]OpenSSL 3.1.4'
// [NUL]OpenSSL 1.1.1w' // [NUL]OpenSSL 1.1.1w'
`\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+([a-z]|-alpha[0-9]|-beta[0-9]|-rc[0-9])?)`, `\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+([a-z]+|-alpha[0-9]|-beta[0-9]|-rc[0-9])?)`,
), ),
Package: "openssl", Package: "openssl",
PURL: mustPURL("pkg:generic/openssl@version"), PURL: mustPURL("pkg:generic/openssl@version"),