Skip to content

Commit

Permalink
fix: match OpenSSL letter releases (#2682)
Browse files Browse the repository at this point in the history
* chore: match openssl 1.1 letter releases

Signed-off-by: Harm Weites <harm@weites.com>

* chore: include image sha

Signed-off-by: Harm Weites <harm@weites.com>

---------

Signed-off-by: Harm Weites <harm@weites.com>
  • Loading branch information
harmw committed Feb 29, 2024
1 parent 6377465 commit 356f7c9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions syft/pkg/cataloger/binary/cataloger_test.go
Expand Up @@ -864,6 +864,17 @@ func Test_Cataloger_PositiveCases(t *testing.T) {
Metadata: metadata("openssl-binary"),
},
},
{
logicalFixture: "openssl/1.1.1w/linux-arm64",
expected: pkg.Package{
Name: "openssl",
Version: "1.1.1w",
Type: "binary",
PURL: "pkg:generic/openssl@1.1.1w",
Locations: locations("openssl"),
Metadata: metadata("openssl-binary"),
},
},
{
logicalFixture: "gcc/12.3.0/linux-amd64",
expected: pkg.Package{
Expand Down
3 changes: 2 additions & 1 deletion syft/pkg/cataloger/binary/default_classifiers.go
Expand Up @@ -386,7 +386,8 @@ func DefaultClassifiers() []Classifier {
FileGlob: "**/openssl",
EvidenceMatcher: FileContentsVersionMatcher(
// [NUL]OpenSSL 3.1.4'
`\x00OpenSSL (?P<version>[0-9]+\.[0-9]+\.[0-9]+(-alpha[0-9]|-beta[0-9]|-rc[0-9])?)`,
// [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])?)`,
),
Package: "openssl",
PURL: mustPURL("pkg:generic/openssl@version"),
Expand Down
Binary file not shown.
8 changes: 8 additions & 0 deletions syft/pkg/cataloger/binary/test-fixtures/config.yaml
Expand Up @@ -462,3 +462,11 @@ from-images:
platform: linux/amd64
paths:
- /bin/consul

- name: openssl
version: 1.1.1w
images:
- ref: openresty/openresty:1.25.3.1-2-alpine@sha256:b1cb45b1556801b8cb1bc29ea78faf2eaf67926a37b052dd070866e44d7df07a
platform: linux/arm64
paths:
- /usr/local/openresty/openssl/bin/openssl

0 comments on commit 356f7c9

Please sign in to comment.