-
Notifications
You must be signed in to change notification settings - Fork 19
openssl: implement cgoless wrappers for C functions #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
1bff9e1 to
51e901b
Compare
…penssl into dev/gadams/cgoless
994a7f6 to
fa14adf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements cgoless wrappers for OpenSSL C functions to enable building Go applications with OpenSSL support without requiring CGO. This is a significant architectural enhancement that provides an alternative implementation path.
- Adds a new nocgo mode to the mkcgo tool for generating CGO-free wrapper code
- Implements dynamic library loading using syscalls instead of CGO for OpenSSL functions
- Provides platform-specific assembly code for system call handling on AMD64 and ARM64
Reviewed Changes
Copilot reviewed 51 out of 52 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ossl/zossl_nocgo.go | Generated nocgo wrapper functions that call OpenSSL via syscalls |
| internal/ossl/zossl_cgo.go | Extracted CGO-specific wrapper functions from main file |
| internal/ossl/zossl.go | Refactored to contain only constants and shared utilities |
| internal/ossl/syscall_nocgo_*.go | Platform-specific syscall implementations for nocgo mode |
| internal/ossl/asm_*.s | Assembly trampolines for system call handling |
| internal/ossl/zdl_nocgo.go | Dynamic library loading functions for nocgo mode |
| internal/ossl/errors_nocgo.go | Error handling implementation for nocgo mode |
| internal/ossl/ossl_nocgo.go | Nocgo-specific OpenSSL utility functions |
| internal/mkcgo/*.go | Enhanced mkcgo tool to support nocgo code generation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
cgoless wrappers are gated behind a build tag for now and not used in the root package.