Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions ebpftracer/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ const (

var (
opensslVersionRe = regexp.MustCompile(`OpenSSL\s(\d\.\d+\.\d+)`)
// Regex to find libraries that look like libssl or libcrypto, even with version numbers.
// e.g., libssl.so.3, libcrypto-74fbf0e0.so.3
libSslRe = regexp.MustCompile(`libssl\.so(\.\d+)*`)
libCryptoRe = regexp.MustCompile(`libcrypto\.so(\.\d+)*`)
// A more specific regex for psycopg2's bundled libs
psycopg2LibRe = regexp.MustCompile(`lib(ssl|crypto)-[a-f0-9]+\.so\.\d+`)
)

func (t *Tracer) AttachOpenSslUprobes(pid uint32) []link.Link {
Expand Down Expand Up @@ -271,13 +277,6 @@ func getSslLibPathAndVersion(pid uint32) (string, string) {
}
defer f.Close()

// Regex to find libraries that look like libssl or libcrypto, even with version numbers.
// e.g., libssl.so.3, libcrypto-74fbf0e0.so.3
libSslRe := regexp.MustCompile(`libssl\.so(\.\d+)*`)
libCryptoRe := regexp.MustCompile(`libcrypto\.so(\.\d+)*`)
// A more specific regex for psycopg2's bundled libs
psycopg2LibRe := regexp.MustCompile(`lib(ssl|crypto)-[a-f0-9]+\.so\.\d+`)

scanner := bufio.NewScanner(f)
scanner.Split(bufio.ScanLines)
var libsslPath, libcryptoPath string
Expand Down