Optimized the FD fetch logic of openssl#905
Conversation
…L probing functions Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…L probing functions Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
…proved clarity Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
… improved modularity Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
✅ E2E Test Results: PASSEDTest Run: #20391124974 Tests Executed:
✅ All e2e tests passed successfully! The TLS capture functionality is working correctly. Automated e2e test results for commit 6eba7c0 |
|
🔧 Debug Build Complete (PR #905) 📦 Download Links: ⏰ Files will be retained for 7 days, please download and test promptly. This build includes debug binaries for: android/linux (arm64/amd64) |
…ctions Signed-off-by: CFC4N <cfc4n.cs@gmail.com>
✅ E2E Test Results: PASSEDTest Run: #20391309120 Tests Executed:
✅ All e2e tests passed successfully! The TLS capture functionality is working correctly. Automated e2e test results for commit 31788e0 |
|
🔧 Debug Build Complete (PR #905) 📦 Download Links: ⏰ Files will be retained for 7 days, please download and test promptly. This build includes debug binaries for: android/linux (arm64/amd64) |
There was a problem hiding this comment.
Pull request overview
This pull request refactors the OpenSSL BIO and file descriptor extraction logic in the eBPF probe code by introducing helper functions to reduce code duplication and improve maintainability. The changes consolidate repeated logic for reading BIO information from SSL objects.
- Introduced
process_SSL_biohelper to extract BIO type and file descriptor from SSL objects - Introduced
probe_entry_SSLandprobe_ret_SSLgeneric helpers to handle SSL read/write probe entry and return logic - Added
should_tracehelper to centralize PID/UID filtering logic
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request refactors the logic for extracting BIO and file descriptor information from SSL objects in the OpenSSL probe code. The main improvement is the introduction of two helper functions to handle reading the read and write BIOs, which reduces code duplication and streamlines error handling in the probe entry functions.
Refactoring and code simplification:
process_SSL_rbioandprocess_SSL_wbioto encapsulate the logic for reading the BIO type and file descriptor from the SSL object's read and write BIOs, respectively. This centralizes error handling and memory access logic.probe_entry_SSL_writeto use the newprocess_SSL_wbiofunction, removing duplicated code for accessing the write BIO and file descriptor. [1] [2]probe_entry_SSL_readto use the newprocess_SSL_rbiofunction, removing duplicated code for accessing the read BIO and file descriptor.