@@ -24,43 +24,43 @@ import (
2424)
2525
2626const (
27- LinuxDefauleFilename_1_0_2 = "linux_default_1_0_2"
28- LinuxDefauleFilename_1_1_0 = "linux_default_1_1_0"
29- LinuxDefauleFilename_1_1_1 = "linux_default_1_1_1"
30- LinuxDefauleFilename_3_0 = "linux_default_3_0"
31- LinuxDefauleFilename_3_1 = "linux_default_3_0"
32- LinuxDefauleFilename_3_2_0 = "linux_default_3_2"
33- AndroidDefauleFilename = "android_default"
27+ Linuxdefaulefilename102 = "linux_default_1_0_2"
28+ Linuxdefaulefilename110 = "linux_default_1_1_0"
29+ Linuxdefaulefilename111 = "linux_default_1_1_1"
30+ Linuxdefaulefilename30 = "linux_default_3_0"
31+ Linuxdefaulefilename31 = "linux_default_3_0"
32+ Linuxdefaulefilename320 = "linux_default_3_2"
33+ AndroidDefauleFilename = "android_default"
3434
3535 OpenSslVersionLen = 30 // openssl version string length
3636)
3737
3838const (
3939 MaxSupportedOpenSSL102Version = 'u'
4040 MaxSupportedOpenSSL110Version = 'l'
41- MaxSupportedOpenSSL111Version = 'u '
42- MaxSupportedOpenSSL30Version = 12
43- MaxSupportedOpenSSL31Version = 4
44- MaxSupportedOpenSSL32Version = 0
41+ MaxSupportedOpenSSL111Version = 'w '
42+ MaxSupportedOpenSSL30Version = 13
43+ MaxSupportedOpenSSL31Version = 5
44+ MaxSupportedOpenSSL32Version = 1
4545)
4646
4747// initOpensslOffset initial BpfMap
4848func (m * MOpenSSLProbe ) initOpensslOffset () {
4949 m .sslVersionBpfMap = map [string ]string {
5050 // openssl 1.0.2*
51- LinuxDefauleFilename_1_0_2 : "openssl_1_0_2a_kern.o" ,
51+ Linuxdefaulefilename102 : "openssl_1_0_2a_kern.o" ,
5252
5353 // openssl 1.1.0*
54- LinuxDefauleFilename_1_1_0 : "openssl_1_1_0a_kern.o" ,
54+ Linuxdefaulefilename110 : "openssl_1_1_0a_kern.o" ,
5555
5656 // openssl 1.1.1*
57- LinuxDefauleFilename_1_1_1 : "openssl_1_1_1j_kern.o" ,
57+ Linuxdefaulefilename111 : "openssl_1_1_1j_kern.o" ,
5858
5959 // openssl 3.0.* and openssl 3.1.*
60- LinuxDefauleFilename_3_0 : "openssl_3_0_0_kern.o" ,
60+ Linuxdefaulefilename30 : "openssl_3_0_0_kern.o" ,
6161
6262 // openssl 3.2.*
63- LinuxDefauleFilename_3_2_0 : "openssl_3_2_0_kern.o" ,
63+ Linuxdefaulefilename320 : "openssl_3_2_0_kern.o" ,
6464
6565 // boringssl
6666 "boringssl 1.1.1" : "boringssl_a_13_kern.o" ,
@@ -94,6 +94,7 @@ func (m *MOpenSSLProbe) initOpensslOffset() {
9494
9595 // openssl 3.1.0 - 3.1.4
9696 for ch := 0 ; ch <= MaxSupportedOpenSSL31Version ; ch ++ {
97+ // The OpenSSL 3.0 series is the same as the 3.1 series of offsets
9798 m .sslVersionBpfMap [fmt .Sprintf ("openssl 3.1.%d" , ch )] = "openssl_3_0_0_kern.o"
9899 }
99100
@@ -233,11 +234,11 @@ func (m *MOpenSSLProbe) detectOpenssl(soPath string) error {
233234 }
234235 } else {
235236 if strings .Contains (soPath , "libssl.so.3" ) {
236- bpfFile , _ = m .sslVersionBpfMap [LinuxDefauleFilename_3_0 ]
237- m .logger .Info ().Str ("OpenSSL Version" , LinuxDefauleFilename_3_0 ).Msg ("OpenSSL/BoringSSL version not found from shared library file, used default version" )
237+ bpfFile , _ = m .sslVersionBpfMap [Linuxdefaulefilename30 ]
238+ m .logger .Info ().Str ("OpenSSL Version" , Linuxdefaulefilename30 ).Msg ("OpenSSL/BoringSSL version not found from shared library file, used default version" )
238239 } else {
239- bpfFile , _ = m .sslVersionBpfMap [LinuxDefauleFilename_1_1_1 ]
240- m .logger .Info ().Str ("OpenSSL Version" , LinuxDefauleFilename_1_1_1 ).Msg ("OpenSSL/BoringSSL version not found from shared library file, used default version" )
240+ bpfFile , _ = m .sslVersionBpfMap [Linuxdefaulefilename111 ]
241+ m .logger .Info ().Str ("OpenSSL Version" , Linuxdefaulefilename111 ).Msg ("OpenSSL/BoringSSL version not found from shared library file, used default version" )
241242 }
242243 }
243244 m .sslBpfFile = bpfFile
0 commit comments