-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from aws/cert-store
Windows and MacOS Certificate Store Integration
- Loading branch information
Showing
35 changed files
with
2,587 additions
and
596 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
build/ | ||
tst/certs/ | ||
credential-process-data/ | ||
tst/softhsm/ | ||
tst/softhsm2.conf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,76 @@ | ||
VERSION=1.0.5 | ||
|
||
release: | ||
go build -buildmode=pie -ldflags "-X 'main.Version=${VERSION}' -linkmode=external -w -s" -trimpath -o build/bin/aws_signing_helper cmd/aws_signing_helper/main.go | ||
go build -buildmode=pie -ldflags "-X 'github.com/aws/rolesanywhere-credential-helper/cmd.Version=${VERSION}' -linkmode=external -w -s" -trimpath -o build/bin/aws_signing_helper main.go | ||
|
||
certsdir=tst/certs | ||
curdir=$(shell pwd) | ||
|
||
RSAKEYS := $(foreach keylen, 1024 2048 4096, $(certsdir)/rsa-$(keylen)-key.pem) | ||
ECKEYS := $(foreach curve, prime256v1 secp384r1, $(certsdir)/ec-$(curve)-key.pem) | ||
PKCS8KEYS := $(patsubst %-key.pem,%-key-pkcs8.pem,$(RSAKEYS) $(ECKEYS)) | ||
ECCERTS := $(foreach digest, sha1 sha256 sha384 sha512, $(patsubst %-key.pem, %-$(digest)-cert.pem, $(ECKEYS))) | ||
RSACERTS := $(foreach digest, md5 sha1 sha256 sha384 sha512, $(patsubst %-key.pem, %-$(digest)-cert.pem, $(RSAKEYS))) | ||
PKCS12CERTS := $(patsubst %-cert.pem, %.p12, $(RSACERTS) $(ECCERTS)) | ||
|
||
test: test-certs | ||
go test -v ./... | ||
|
||
%-md5-cert.pem: %-key.pem | ||
SUBJ=$$(echo "$@" | sed -r 's|.*/([^/]+)-cert.pem|\1|'); \ | ||
openssl req -x509 -new -key $< -out $@ -days 10000 -subj "/CN=roles-anywhere-$${SUBJ}" -md5 | ||
%-sha1-cert.pem: %-key.pem | ||
SUBJ=$$(echo "$@" | sed -r 's|.*/([^/]+)-cert.pem|\1|'); \ | ||
openssl req -x509 -new -key $< -out $@ -days 10000 -subj "/CN=roles-anywhere-$${SUBJ}" -sha1 | ||
%-sha256-cert.pem: %-key.pem | ||
SUBJ=$$(echo "$@" | sed -r 's|.*/([^/]+)-cert.pem|\1|'); \ | ||
openssl req -x509 -new -key $< -out $@ -days 10000 -subj "/CN=roles-anywhere-$${SUBJ}" -sha256 | ||
%-sha384-cert.pem: %-key.pem | ||
SUBJ=$$(echo "$@" | sed -r 's|.*/([^/]+)-cert.pem|\1|'); \ | ||
openssl req -x509 -new -key $< -out $@ -days 10000 -subj "/CN=roles-anywhere-$${SUBJ}" -sha384 | ||
%-sha512-cert.pem: %-key.pem | ||
SUBJ=$$(echo "$@" | sed -r 's|.*/([^/]+)-cert.pem|\1|'); \ | ||
openssl req -x509 -new -key $< -out $@ -days 10000 -subj "/CN=roles-anywhere-$${SUBJ}" -sha512 | ||
|
||
# Go PKCS#12 only supports SHA1 and 3DES!! | ||
%.p12: %-pass.p12 | ||
echo Creating $@... | ||
ls -l $< | ||
KEY=$$(echo "$@" | sed 's/-[^-]*\.p12/-key.pem/'); \ | ||
CERT=$$(echo "$@" | sed 's/.p12/-cert.pem/'); \ | ||
openssl pkcs12 -export -passout pass: -macalg SHA1 \ | ||
-certpbe pbeWithSHA1And3-KeyTripleDES-CBC \ | ||
-keypbe pbeWithSHA1And3-KeyTripleDES-CBC \ | ||
-inkey $${KEY} -out "$@" -in $${CERT} | ||
|
||
%-pass.p12: %-cert.pem | ||
echo Creating $@... | ||
ls -l $< | ||
KEY=$$(echo "$@" | sed 's/-[^-]*\-pass.p12/-key.pem/'); \ | ||
openssl pkcs12 -export -passout pass:test -macalg SHA1 \ | ||
-certpbe pbeWithSHA1And3-KeyTripleDES-CBC \ | ||
-keypbe pbeWithSHA1And3-KeyTripleDES-CBC \ | ||
-inkey $${KEY} -out "$@" -in "$<" | ||
|
||
%-pkcs8.pem: %.pem | ||
openssl pkcs8 -topk8 -inform PEM -outform PEM -in $< -out $@ -nocrypt | ||
|
||
$(RSAKEYS): | ||
KEYLEN=$$(echo "$@" | sed 's/.*rsa-\([0-9]*\)-key.pem/\1/'); \ | ||
openssl genrsa -out $@ $${KEYLEN} | ||
|
||
$(ECKEYS): | ||
CURVE=$$(echo "$@" | sed 's/.*ec-\([^-]*\)-key.pem/\1/'); \ | ||
openssl ecparam -name $${CURVE} -genkey -out $@ | ||
|
||
$(certsdir)/cert-bundle.pem: $(RSACERTS) $(ECCERTS) | ||
cat $^ > $@ | ||
|
||
test-certs: $(PKCS8KEYS) $(RSAKEYS) $(ECKEYS) $(RSACERTS) $(ECCERTS) $(PKCS12CERTS) $(certsdir)/cert-bundle.pem | ||
|
||
test-clean: | ||
rm -f $(RSAKEYS) $(ECKEYS) | ||
rm -f $(PKCS8KEYS) | ||
rm -f $(RSACERTS) $(ECCERTS) | ||
rm -f $(PKCS12CERTS) | ||
rm -f $(certsdir)/cert-bundle.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
** smimesign; version v0.2.0-rc1 -- https://github.com/github/smimesign | ||
Copyright (c) 2017 GitHub, Inc. | ||
|
||
MIT License | ||
|
||
Copyright (c) 2017 GitHub, Inc. | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
|
Oops, something went wrong.