Skip to content

Commit

Permalink
Add CROSS-COMPILE.md, rm CLA link
Browse files Browse the repository at this point in the history
  • Loading branch information
csstaub committed Feb 17, 2018
1 parent 265ca24 commit d9aad30
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 19 deletions.
19 changes: 7 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
# Contributing
# Contributing guidelines

If you would like to contribute code to ghostunnel you can do so through GitHub
by forking the repository and sending a pull request.

When submitting code, please make every effort to follow existing conventions
and style in order to keep the code as readable as possible. Please also make
sure all tests pass by running `make test`, and format your code with `go fmt`.
When submitting code, please make efforts to follow existing conventions and
style in order to keep the code as readable as possible. Please also make sure
all tests pass by running `make test`, and format your code with `go fmt`.

Note that ghostunnel relies heavily on integration tests written in Python that
run checks on a live instance. If you are adding new features or changing
existing behavior, please add/update the integration tests in the tests directory
accordingly.

Before your code can be accepted into the project you must also sign the
[Individual Contributor License Agreement][1].

[1]: https://spreadsheets.google.com/spreadsheet/viewform?formkey=dDViT2xzUHAwRkI3X3k5Z0lQM091OGc6MQ&ndplr=1
run checks on a live instance. If you are adding new features or changing
existing behavior, please add/update the integration tests in the tests
directory accordingly.
24 changes: 24 additions & 0 deletions CROSS-COMPILE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Instructions for cross-compiling

Ghostunnel has support for loading private keys from PKCS#11 modules, which
should work with any hardware security module that exposes a PKCS#11 interface.
A working CGO toolchain is required in order to compile with PKCS#11 support
enabled.

One way to cross-compile ghostunnel is with [karalabe/xgo][xgo]. Note that
libtool is a required build dependency, and libltdl needs to be available at
runtime. You can build a static binary to avoid the libltdl runtime dependency
by passing appropriate ldflags to the compiler.

For example, to build a static 64-bit Windows binary:

xgo \
-deps https://ftp.gnu.org/pub/gnu/libtool/libtool-2.4.6.tar.gz \
-branch master \
-targets 'windows/amd64' \
-ldflags "-w -extldflags \"-static\" -extld x86_64-w64-mingw32-gcc" \
github.com/square/ghostunnel

For more info, see [xgo][xgo]'s README on GitHub.

[xgo]: https://github.com/karalabe/xgo
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,10 @@ To run tests:
# Open coverage information in browser
go tool cover -html coverage-merged.out

For more information on how to contribute, please see the [CONTRIBUTING][contr] file.
For more information on how to contribute, please see the [CONTRIBUTING](CONTRIBUTING.md) file.

[gvt]: https://github.com/FiloSottile/gvt
[gcvm]: https://github.com/wadey/gocovmerge
[contr]: https://github.com/square/ghostunnel/blob/master/CONTRIBUTING.md

Usage Examples
==============
Expand Down Expand Up @@ -248,11 +247,12 @@ For information on profiling via pprof, see the

### HSM/PKCS#11 support

Ghostunnel has experimental support for loading private keys from PKCS#11
modules, which should work with any hardware security module that exposes a
PKCS#11 interface. An easy way to test the PKCS#11 interface for development
purposes is with [SoftHSM][softhsm]. Note that CGO is required in order for
PKCS#11 support to work.
Ghostunnel has support for loading private keys from PKCS#11 modules, which
should work with any hardware security module that exposes a PKCS#11 interface.
An easy way to test the PKCS#11 interface for development purposes is with
[SoftHSM][softhsm]. Note that CGO is required in order for PKCS#11 support to
work (see [CROSS-COMPILE.md](CROSS-COMPILE.md) for instructions to
cross-compile with CGO enabled).

[softhsm]: https://github.com/opendnssec/SoftHSMv2

Expand Down

0 comments on commit d9aad30

Please sign in to comment.