Skip to content

Commit

Permalink
user/module : use const for SSL masterKey function hook.
Browse files Browse the repository at this point in the history
1. SSL_do_handshake for Android.
2. SSL_write for Linux

`SSL_do_handshake` was null sometimes on Linux .

Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
  • Loading branch information
cfc4n committed Sep 28, 2022
1 parent e6cc37b commit 7b1e8e5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions user/module/const_androidgki.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build androidgki
// +build androidgki

package module

/*
Copyright © 2022 CFC4N <cfc4n.cs@gmail.com>
*/

const (
PROBE_OPENSSL_MASTERKEY_FUNC = "SSL_do_handshake"
)
13 changes: 13 additions & 0 deletions user/module/const_linux.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build !androidgki
// +build !androidgki

package module

/*
Copyright © 2022 CFC4N <cfc4n.cs@gmail.com>
*/

const (
PROBE_OPENSSL_MASTERKEY_FUNC = "SSL_write"
)
2 changes: 1 addition & 1 deletion user/module/probe_openssl_tc.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (this *MOpenSSLProbe) setupManagersTC() error {
{
Section: "uprobe/SSL_write_key",
EbpfFuncName: "probe_ssl_master_key",
AttachToFuncName: "SSL_do_handshake", // SSL_do_handshake or SSL_write
AttachToFuncName: PROBE_OPENSSL_MASTERKEY_FUNC, // SSL_do_handshake or SSL_write
BinaryPath: binaryPath,
UID: "uprobe_ssl_master_key",
},
Expand Down

0 comments on commit 7b1e8e5

Please sign in to comment.