Skip to content

Commit 682ac2b

Browse files
committed
fix: support OpenSSL 3.6.x
1 parent 20057f6 commit 682ac2b

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

agent/uprobe/ssl_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ import (
77
"github.com/stretchr/testify/assert"
88
)
99

10+
func TestOpenSSL36VersionsAreMapped(t *testing.T) {
11+
for _, versionKey := range []string{
12+
"openssl 3.6.0",
13+
"openssl 3.6.1",
14+
"openssl 3.6.2",
15+
} {
16+
assert.NotNil(t, sslVersionBpfMap[versionKey], versionKey)
17+
}
18+
}
19+
1020
func TestDetectOpenSsl(t *testing.T) {
1121
key, err := detectOpenSsl(2276284)
1222
assert.Nil(t, err)

agent/uprobe/types.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ const (
9090
MaxSupportedOpenSSL33Version = 2
9191
SupportedOpenSSL34Version0 = 1 // openssl 3.4.0
9292
SupportedOpenSSL35Version0 = 5 // openssl 3.5.0 ~ 3.5.5
93+
SupportedOpenSSL36Version0 = 2 // openssl 3.6.0 ~ 3.6.2
9394
)
9495
const (
9596
Linuxdefaulefilename102 = "linux_default_1_0_2"
@@ -325,7 +326,7 @@ func initOpensslOffset() {
325326
}
326327
}
327328

328-
// openssl 3.5.0
329+
// openssl 3.5.0 - 3.5.5
329330
for ch := 0; ch <= SupportedOpenSSL35Version0; ch++ {
330331
sslVersionBpfMap[fmt.Sprintf("openssl 3.5.%d", ch)] = func() (*ebpf.CollectionSpec, any, error) {
331332
r, err := bpf.LoadOpenssl350()
@@ -337,6 +338,18 @@ func initOpensslOffset() {
337338
}
338339
}
339340

341+
// openssl 3.6.0 - 3.6.2
342+
for ch := 0; ch <= SupportedOpenSSL36Version0; ch++ {
343+
sslVersionBpfMap[fmt.Sprintf("openssl 3.6.%d", ch)] = func() (*ebpf.CollectionSpec, any, error) {
344+
r, err := bpf.LoadOpenssl350()
345+
if err != nil {
346+
common.UprobeLog.Errorln(err)
347+
return nil, nil, err
348+
}
349+
return r, &bpf.Openssl350Objects{}, nil
350+
}
351+
}
352+
340353
// openssl 1.1.0a - 1.1.0l
341354
for ch := 'a'; ch <= MaxSupportedOpenSSL110Version; ch++ {
342355
sslVersionBpfMap["openssl 1.1.0"+string(ch)] = func() (*ebpf.CollectionSpec, any, error) {

0 commit comments

Comments
 (0)