Skip to content

Commit

Permalink
Check proper initialization for SupportEd25519 (#204)
Browse files Browse the repository at this point in the history
* fix:add fips clause for SupportEd25519

* fix:add fips clause for SupportEd25519

* fix:add fips clause for SupportEd25519

* fix: remove initialized evp_pkey_ctx

* fix:add a short circuit for versionAtOrAbove

* fix:since all tests are passing in mariner2, remove continue on error clause
  • Loading branch information
mertakman authored Oct 8, 2024
1 parent 59d3cb9 commit 1ca42ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,4 @@ jobs:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Run Test
# This line is temporary. We are currently working on a fix to fully support Mariner 2.0. Once the fix is merged, we will remove this line.
continue-on-error: true
run: go test -v ./...
8 changes: 7 additions & 1 deletion ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,13 @@ func SupportsEd25519() bool {
onceSupportsEd25519.Do(func() {
switch vMajor {
case 1:
supportsEd25519 = versionAtOrAbove(1, 1, 1)
if versionAtOrAbove(1, 1, 1) {
ctx := C.go_openssl_EVP_PKEY_CTX_new_id(C.GO_EVP_PKEY_ED25519, nil)
if ctx != nil {
C.go_openssl_EVP_PKEY_CTX_free(ctx)
supportsEd25519 = true
}
}
case 3:
name := C.CString("ED25519")
defer C.free(unsafe.Pointer(name))
Expand Down

0 comments on commit 1ca42ef

Please sign in to comment.