Skip to content
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

Fix build for m1 #149

Open
wants to merge 69 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
80f7894
feat: add Equal method to compare keys
dignifiedquire Jun 28, 2019
01a7c5e
move to libp2p
Stebalien Jun 29, 2019
0298788
Merge pull request #1 from dignifiedquire/feat/key-equals
Stebalien Jun 29, 2019
7e0f41e
feat: add freebsd support
Stebalien Jul 26, 2019
adf4e19
Merge pull request #2 from libp2p/fix/freebsd
Stebalien Jul 31, 2019
3d5df67
feat: openbsd support
Stebalien Aug 1, 2019
1934e45
readme: add motivation for forking.
raulk Aug 2, 2019
f996844
feat: add Size function to PublicKey
Stebalien Oct 21, 2019
f25c826
Merge pull request #3 from libp2p/feat/sig-size
Stebalien Oct 21, 2019
da4f08f
pass build flags on Solaris/Illumos
djdv Nov 13, 2019
418fabf
Merge pull request #4 from djdv/build/solaris
Stebalien Dec 7, 2019
fe1fe4c
add binding for OBJ_create
poonai May 10, 2020
5f2730c
minor license yaer change
poonai May 10, 2020
050e850
Merge pull request #5 from balajijinnah/balaji/create_obj_identifier
Stebalien May 10, 2020
09d7258
- add custom extension support
poonai May 23, 2020
df5f786
Merge branch 'master' of https://github.com/libp2p/go-openssl into ba…
poonai May 23, 2020
1fdf237
remove unwanted
poonai May 23, 2020
38a6bec
fix comments
poonai Jun 13, 2020
ab3d2c3
Merge pull request #6 from balajijinnah/balaji/tls
Stebalien Jun 15, 2020
f4030af
refactor: make Ed25519 keys less special cased
aschmahmann Jul 29, 2020
d9b6402
Merge pull request #7 from libp2p/refactor/ed25519-less-special
aschmahmann Jul 29, 2020
6d00a81
Enabled PEM files with CRLF line endings to be used (#10); made PEM f…
stephaneberle9 Oct 1, 2020
6f65c2c
Merge pull request #11 from stephaneberle9/master
aschmahmann Oct 16, 2020
597b898
Address `staticcheck` issues
masih Jul 19, 2021
219d074
Merge pull request #14 from libp2p/fix-lint-issues-pre-ci
Stebalien Jul 20, 2021
5bb7e0e
Update test RSA cert
Aug 14, 2021
f5ecaf4
test: don't try to marshal ed25519 to PEM
Stebalien Aug 27, 2021
d2721d9
test: handle closing quirks
Stebalien Aug 27, 2021
cfeec8e
Merge pull request #16 from libp2p/fix/tests
Stebalien Aug 27, 2021
8e95e0f
Merge pull request #15 from jbouwman/update-cert-md
marten-seemann Aug 27, 2021
ecfa88c
fix: unsafe pointer passing
Stebalien Aug 27, 2021
a04acfd
Merge pull request #18 from libp2p/fix/pointer-passing
Stebalien Aug 27, 2021
523a9c8
add version.json file
web3-bot Dec 10, 2021
55c3c00
bump go.mod to Go 1.16 and run go fix
web3-bot Dec 10, 2021
19eed5d
run gofmt -s
web3-bot Dec 10, 2021
ed6a5ab
add .github/workflows/automerge.yml
web3-bot Dec 10, 2021
f0bfe9c
add .github/workflows/go-test.yml
web3-bot Dec 10, 2021
0ce1691
add .github/workflows/go-check.yml
web3-bot Dec 10, 2021
4ce5b67
add .github/workflows/releaser.yml
web3-bot Dec 10, 2021
e7bb135
add .github/workflows/release-check.yml
web3-bot Dec 10, 2021
0e129fb
add .github/workflows/tagpush.yml
web3-bot Dec 10, 2021
77c1db3
update .github/workflows/go-test.yml
galargh Jan 31, 2022
b84a4bc
add go-test-setup action
galargh Jan 31, 2022
1cac8de
Merge pull request #20 from libp2p/web3-bot/sync-msys2
galargh Feb 1, 2022
0fadeb4
Merge pull request #17 from libp2p/web3-bot/sync
galargh Feb 1, 2022
b691872
Fix build for m1
nathan454 Feb 23, 2022
fa2d6fa
Add openssl.DialTimeout(network, addr, timeout, ctx, flags) call
oleg-jukovec Apr 15, 2022
2a66498
Add Ctx.SetMinProtoVersion and Ctx.SetMaxProtoVersion wrappers
oleg-jukovec Apr 15, 2022
8b7f1f9
bump go.mod to Go 1.17 and run go fix
web3-bot Jun 1, 2022
4219017
update .github/workflows/automerge.yml
web3-bot Jun 1, 2022
4939bdc
update .github/workflows/go-test.yml
web3-bot Jun 1, 2022
de18fa1
update .github/workflows/go-check.yml
web3-bot Jun 1, 2022
6a218fb
Merge pull request #27 from oleg-jukovec/SSL_CTX_set_min_max_proto_ve…
MarcoPolo Jun 3, 2022
e25825b
Merge pull request #26 from oleg-jukovec/openssl-dialtimeout-call
MarcoPolo Jun 3, 2022
54131cd
Update action.yml
galargh Jun 6, 2022
7de17e1
Update action.yml
galargh Jun 6, 2022
831acee
Update action.yml
galargh Jun 6, 2022
8ff2bb0
Update action.yml
galargh Jun 6, 2022
5389452
Merge pull request #30 from libp2p/galargh-patch-2
galargh Jun 6, 2022
0250c31
Merge remote-tracking branch 'origin/master' into web3-bot/sync
galargh Jun 6, 2022
3239254
chore: go fmt
galargh Jun 6, 2022
d09e3c5
Merge pull request #24 from libp2p/web3-bot/sync
galargh Jun 6, 2022
46d44e1
Fix build with OpenSSL 3.0 (#25)
oleg-jukovec Aug 18, 2022
6f749a6
release v0.1.0 (#31)
marten-seemann Aug 18, 2022
176c5cd
chore: Update .github/workflows/stale.yml [skip ci]
libp2p-mgmt-read-write[bot] Sep 19, 2022
00b6080
sync: update CI config files (#34)
web3-bot Sep 21, 2022
95285c1
Merge branch 'master' into fix-mac-m1-build
nathan454 Nov 30, 2022
b87a2b8
Update build.go
nathan454 Nov 30, 2022
a11554e
Update build_static.go
nathan454 Nov 30, 2022
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
25 changes: 25 additions & 0 deletions .github/actions/go-test-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Go Test Setup
description: Set up the environment for go test
runs:
using: "composite"
steps:
- name: Common setup
shell: bash
run: |
echo 'CGO_ENABLED=1' >> $GITHUB_ENV
- name: Windows setup
shell: bash
if: ${{ runner.os == 'Windows' }}
run: |
pacman -S --noconfirm mingw-w64-x86_64-toolchain mingw-w64-i686-toolchain
echo '/c/msys64/mingw64/bin' >> $GITHUB_PATH
echo 'PATH_386=/c/msys64/mingw32/bin:${{ env.PATH_386 }}' >> $GITHUB_ENV
- name: Linux setup
shell: bash
if: ${{ runner.os == 'Linux' }}
run: |
sudo apt-get install gcc-multilib
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libssl-dev:i386
echo 'CC_FOR_linux_386=i686-w64-mingw32-gcc'
11 changes: 11 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: Automerge
on: [ pull_request ]

jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'
73 changes: 73 additions & 0 deletions .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

on: [push, pull_request]
name: Go Checks

jobs:
unit:
runs-on: ubuntu-latest
name: All
env:
RUNGOGENERATE: false
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version: "1.19.x"
- name: Run repo-specific setup
uses: ./.github/actions/go-check-setup
if: hashFiles('./.github/actions/go-check-setup') != ''
- name: Read config
if: hashFiles('./.github/workflows/go-check-config.json') != ''
run: |
if jq -re .gogenerate ./.github/workflows/go-check-config.json; then
echo "RUNGOGENERATE=true" >> $GITHUB_ENV
fi
- name: Install staticcheck
run: go install honnef.co/go/tools/cmd/staticcheck@376210a89477dedbe6fdc4484b233998650d7b3c # 2022.1.3 (v0.3.3)
- name: Check that go.mod is tidy
uses: protocol/[email protected]
with:
run: |
go mod tidy
if [[ -n $(git ls-files --other --exclude-standard --directory -- go.sum) ]]; then
echo "go.sum was added by go mod tidy"
exit 1
fi
git diff --exit-code -- go.sum go.mod
- name: gofmt
if: ${{ success() || failure() }} # run this step even if the previous one failed
run: |
out=$(gofmt -s -l .)
if [[ -n "$out" ]]; then
echo $out | awk '{print "::error file=" $0 ",line=0,col=0::File is not gofmt-ed."}'
exit 1
fi
- name: go vet
if: ${{ success() || failure() }} # run this step even if the previous one failed
uses: protocol/[email protected]
with:
run: go vet ./...
- name: staticcheck
if: ${{ success() || failure() }} # run this step even if the previous one failed
uses: protocol/[email protected]
with:
run: |
set -o pipefail
staticcheck ./... | sed -e 's@\(.*\)\.go@./\1.go@g'
- name: go generate
uses: protocol/[email protected]
if: (success() || failure()) && env.RUNGOGENERATE == 'true'
with:
run: |
git clean -fd # make sure there aren't untracked files / directories
go generate ./...
# check if go generate modified or added any files
if ! $(git add . && git diff-index HEAD --exit-code --quiet); then
echo "go generated caused changes to the repository:"
git status --short
exit 1
fi
69 changes: 69 additions & 0 deletions .github/workflows/go-test-ubuntu-22.04.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# See:
# https://github.com/libp2p/go-openssl/pull/25
# https://github.com/protocol/.github/issues/349
# for details.
on: [push, pull_request]
name: Go Test

jobs:
unit:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-22.04" ]
go: [ "1.17.x", "1.18.x" ]
env:
COVERAGES: ""
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Go information
run: |
go version
go env
- name: Use msys2 on windows
if: startsWith(matrix.os, 'windows')
shell: bash
# The executable for msys2 is also called bash.cmd
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- name: Run repo-specific setup
uses: ./.github/actions/go-test-setup
if: hashFiles('./.github/actions/go-test-setup') != ''
- name: Run tests
uses: protocol/[email protected]
with:
# Use -coverpkg=./..., so that we include cross-package coverage.
# If package ./A imports ./B, and ./A's tests also cover ./B,
# this means ./B's coverage will be significantly higher than 0%.
run: go test -v -coverprofile=module-coverage.txt -coverpkg=./... ./...
- name: Run tests (32 bit)
if: startsWith(matrix.os, 'macos') == false # can't run 32 bit tests on OSX.
uses: protocol/[email protected]
env:
GOARCH: 386
with:
run: |
export "PATH=${{ env.PATH_386 }}:$PATH"
go test -v ./...
- name: Run tests with race detector
if: startsWith(matrix.os, 'ubuntu') # speed things up. Windows and OSX VMs are slow
uses: protocol/[email protected]
with:
run: go test -v -race ./...
- name: Collect coverage files
shell: bash
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Upload coverage to Codecov
uses: codecov/codecov-action@f32b3a3741e1053eb607407145bc9619351dc93b # v2.1.0
with:
files: '${{ env.COVERAGES }}'
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}
68 changes: 68 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

on: [push, pull_request]
name: Go Test

jobs:
unit:
strategy:
fail-fast: false
matrix:
os: [ "ubuntu", "windows", "macos" ]
go: [ "1.18.x", "1.19.x" ]
env:
COVERAGES: ""
runs-on: ${{ format('{0}-latest', matrix.os) }}
name: ${{ matrix.os }} (go ${{ matrix.go }})
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- name: Go information
run: |
go version
go env
- name: Use msys2 on windows
if: ${{ matrix.os == 'windows' }}
shell: bash
# The executable for msys2 is also called bash.cmd
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md#shells
# If we prepend its location to the PATH
# subsequent 'shell: bash' steps will use msys2 instead of gitbash
run: echo "C:/msys64/usr/bin" >> $GITHUB_PATH
- name: Run repo-specific setup
uses: ./.github/actions/go-test-setup
if: hashFiles('./.github/actions/go-test-setup') != ''
- name: Run tests
uses: protocol/[email protected]
with:
# Use -coverpkg=./..., so that we include cross-package coverage.
# If package ./A imports ./B, and ./A's tests also cover ./B,
# this means ./B's coverage will be significantly higher than 0%.
run: go test -v -shuffle=on -coverprofile=module-coverage.txt -coverpkg=./... ./...
- name: Run tests (32 bit)
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on OSX.
uses: protocol/[email protected]
env:
GOARCH: 386
with:
run: |
export "PATH=${{ env.PATH_386 }}:$PATH"
go test -v -shuffle=on ./...
- name: Run tests with race detector
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
uses: protocol/[email protected]
with:
run: go test -v -race ./...
- name: Collect coverage files
shell: bash
run: echo "COVERAGES=$(find . -type f -name 'module-coverage.txt' | tr -s '\n' ',' | sed 's/,$//')" >> $GITHUB_ENV
- name: Upload coverage to Codecov
uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
files: '${{ env.COVERAGES }}'
env_vars: OS=${{ matrix.os }}, GO=${{ matrix.go }}
11 changes: 11 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: Release Checker
on:
pull_request:
paths: [ 'version.json' ]

jobs:
release-check:
uses: protocol/.github/.github/workflows/release-check.yml@master
11 changes: 11 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: Releaser
on:
push:
paths: [ 'version.json' ]

jobs:
releaser:
uses: protocol/.github/.github/workflows/releaser.yml@master
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Close and mark stale issue

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-issue-label: 'kind/stale'
any-of-labels: 'need/author-input'
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
days-before-issue-stale: 6
days-before-issue-close: 7
enable-statistics: true
12 changes: 12 additions & 0 deletions .github/workflows/tagpush.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: Tag Push Checker
on:
push:
tags:
- v*

jobs:
releaser:
uses: protocol/.github/.github/workflows/tagpush.yml@master
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
# OpenSSL bindings for Go

Please see http://godoc.org/github.com/spacemonkeygo/openssl for more info
Forked from https://github.com/spacemonkeygo/openssl (unmaintained) to add:

1. FreeBSD support.
2. Key equality checking.
3. A function to get the size of signatures produced by a key.

---

Please see http://godoc.org/github.com/libp2p/go-openssl for more info

---

### License

Expand Down
19 changes: 19 additions & 0 deletions alloc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package openssl

// #include "shim.h"
import "C"

import (
"unsafe"

"github.com/mattn/go-pointer"
)

//export go_ssl_crypto_ex_free
func go_ssl_crypto_ex_free(
parent *C.void, ptr unsafe.Pointer,
cryptoData *C.CRYPTO_EX_DATA, idx C.int,
argl C.long, argp *C.void,
) {
pointer.Unref(ptr)
}
Loading