diff --git a/README.md b/README.md index 6bd3383..3f11c87 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,10 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. +### Using on macOS +1. Install [homebrew](http://brew.sh/) +2. `$ brew install openssl` or `$ brew install openssl@1.1` + ### Using on Windows 1. Install [mingw-w64](http://mingw-w64.sourceforge.net/) 2. Install [pkg-config-lite](http://sourceforge.net/projects/pkgconfiglite) diff --git a/bio.go b/bio.go index b8d32e0..9242853 100644 --- a/bio.go +++ b/bio.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/build.go b/build.go index 94720e3..0c172da 100644 --- a/build.go +++ b/build.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #cgo pkg-config: libssl libcrypto diff --git a/cert.go b/cert.go index 45754ac..a04d37a 100644 --- a/cert.go +++ b/cert.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/ciphers.go b/ciphers.go index f916b4c..1b4fde0 100644 --- a/ciphers.go +++ b/ciphers.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/ciphers_gcm.go b/ciphers_gcm.go index e21b2e5..97a7eda 100644 --- a/ciphers_gcm.go +++ b/ciphers_gcm.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo,!darwin - package openssl // #include diff --git a/ciphers_test.go b/ciphers_test.go index d1d430b..21132e2 100644 --- a/ciphers_test.go +++ b/ciphers_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build !darwin - package openssl import ( diff --git a/conn.go b/conn.go index 3022829..05ecd81 100644 --- a/conn.go +++ b/conn.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/ctx.go b/ctx.go index ee6a3f8..3589c2a 100644 --- a/ctx.go +++ b/ctx.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/dhparam.go b/dhparam.go index 23b939f..1bdb28a 100644 --- a/dhparam.go +++ b/dhparam.go @@ -1,5 +1,3 @@ -// +build cgo - package openssl // #include "shim.h" diff --git a/digest.go b/digest.go index 77f159c..9b42eb9 100644 --- a/digest.go +++ b/digest.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/engine.go b/engine.go index 7a175b7..7d6d9bc 100644 --- a/engine.go +++ b/engine.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl /* diff --git a/fips.go b/fips.go index b3a03fa..3ae4152 100644 --- a/fips.go +++ b/fips.go @@ -1,5 +1,3 @@ -// +build cgo - package openssl /* diff --git a/hmac.go b/hmac.go index e12d5d9..3c75f70 100644 --- a/hmac.go +++ b/hmac.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/hmac_test.go b/hmac_test.go index 03b5d46..fcb55e0 100644 --- a/hmac_test.go +++ b/hmac_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl import ( diff --git a/hostname.go b/hostname.go index 8c3b8e8..93dedd4 100644 --- a/hostname.go +++ b/hostname.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl /* diff --git a/init.go b/init.go index 48c71f2..7841c24 100644 --- a/init.go +++ b/init.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - /* Package openssl is a light wrapper around OpenSSL for Go. diff --git a/init_posix.go b/init_posix.go index 559ac1e..2a187d5 100644 --- a/init_posix.go +++ b/init_posix.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build linux darwin cgo +// +build linux darwin // +build !windows package openssl diff --git a/init_windows.go b/init_windows.go index 6006996..32d498c 100644 --- a/init_windows.go +++ b/init_windows.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build windows cgo +// +build windows package openssl diff --git a/key.go b/key.go index e6f08c6..cf0b32f 100644 --- a/key.go +++ b/key.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/mapping.go b/mapping.go index 066aba6..8a806bf 100644 --- a/mapping.go +++ b/mapping.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl import ( diff --git a/old_openssl_compat.go b/old_openssl_compat.go deleted file mode 100644 index 028f13b..0000000 --- a/old_openssl_compat.go +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2014 Space Monkey, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// +build !darwin brew -// +build cgo - -package openssl - -// #include -import "C" - -// these constants do not exist in the openssl version packaged with os x. when -// darwin decides to update the base openssl version, we can move these back -// to the appropriate spots in the source. as a workaround, if you need access -// to these constants on darwin, use homebrew or whatever to install a more -// recent version of os x, and build the package with the '-tags brew' flag - -const ( - UnsupportedConstraintSyntax VerifyResult = C.X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX - UnsupportedConstraintType VerifyResult = C.X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE - UnsupportedExtensionFeature VerifyResult = C.X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE - ExcludedViolation VerifyResult = C.X509_V_ERR_EXCLUDED_VIOLATION - SubtreeMinmax VerifyResult = C.X509_V_ERR_SUBTREE_MINMAX - UnsupportedNameSyntax VerifyResult = C.X509_V_ERR_UNSUPPORTED_NAME_SYNTAX - DifferentCrlScope VerifyResult = C.X509_V_ERR_DIFFERENT_CRL_SCOPE - PermittedViolation VerifyResult = C.X509_V_ERR_PERMITTED_VIOLATION - CrlPathValidationError VerifyResult = C.X509_V_ERR_CRL_PATH_VALIDATION_ERROR -) - -const ( - NoTLSv1_1 Options = C.SSL_OP_NO_TLSv1_1 - NoTLSv1_2 Options = C.SSL_OP_NO_TLSv1_2 -) diff --git a/sha1.go b/sha1.go index e479b80..bc7264e 100644 --- a/sha1.go +++ b/sha1.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/sha1_test.go b/sha1_test.go index 37037e4..0c37cf6 100644 --- a/sha1_test.go +++ b/sha1_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl import ( diff --git a/sha256.go b/sha256.go index 922f2f3..3444ace 100644 --- a/sha256.go +++ b/sha256.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/sha256_test.go b/sha256_test.go index 89df88a..6ed7b58 100644 --- a/sha256_test.go +++ b/sha256_test.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl import ( diff --git a/ssl.go b/ssl.go index eda530a..daf7af9 100644 --- a/ssl.go +++ b/ssl.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h" diff --git a/tickets.go b/tickets.go index 6000d27..c85b731 100644 --- a/tickets.go +++ b/tickets.go @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build cgo - package openssl // #include "shim.h"