-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Fotis Nikolaidis <[email protected]>
- Loading branch information
Showing
18 changed files
with
604 additions
and
27 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
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 |
---|---|---|
|
@@ -44,6 +44,7 @@ The following have contributed code and/or documentation to this repository. | |
- Eng Zer Jun <[email protected]> | ||
- Eric Müller <[email protected]> | ||
- Felix Abecassis <[email protected]> | ||
- Fotis Nikolaidis <[email protected]> | ||
- Geoffroy Vallee <[email protected]>, <[email protected]> | ||
- George Hartzell <[email protected]> | ||
- Gert Hulselmans <[email protected]> | ||
|
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,7 @@ | ||
#!/bin/bash | ||
|
||
# Step 1: Get the leaf certificate | ||
openssl s_client -connect www.akamai.com:443 < /dev/null 2>&1 | sed -n '/-----BEGIN/,/-----END/p' > leaf.pem | ||
|
||
# Step 2: Get the intermediate certificate | ||
openssl s_client -showcerts -connect www.akamai.com:443 < /dev/null 2>&1 | sed -n '/-----BEGIN/,/-----END/p' > intermediate.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
-----BEGIN CERTIF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VR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQG | ||
CCsGAQUFBwMBBggrBgEFBQcDAjB2BggrBgEFBQcBAQRqMGgwJAYIKwYBBQUHMAGG | ||
GGh0dHA6Ly9vY3NwLmRpZ2ljZXJ0LmNvbTBABggrBgEFBQcwAoY0aHR0cDovL2Nh | ||
Y2VydHMuZGlnaWNlcnQuY29tL0RpZ2lDZXJ0R2xvYmFsUm9vdENBLmNydDBCBgNV | ||
HR8EOzA5MDegNaAzhjFodHRwOi8vY3JsMy5kaWdpY2VydC5jb20vRGlnaUNlcnRH | ||
bG9iYWxSb290Q0EuY3JsMD0GA1UdIAQ2MDQwCwYJYIZIAYb9bAIBMAcGBWeBDAEB | ||
MAgGBmeBDAECATAIBgZngQwBAgIwCAYGZ4EMAQIDMA0GCSqGSIb3DQEBCwUAA4IB | ||
AQCAMs5eC91uWg0Kr+HWhMvAjvqFcO3aXbMM9yt1QP6FCvrzMXi3cEsaiVi6gL3z | ||
ax3pfs8LulicWdSQ0/1s/dCYbbdxglvPbQtaCdB73sRD2Cqk3p5BJl+7j5nL3a7h | ||
qG+fh/50tx8bIKuxT8b1Z11dmzzp/2n3YWzW2fP9NsarA4h20ksudYbj/NhVfSbC | ||
EXffPgK2fPOre3qGNm+499iTcc+G33Mw+nur7SpZyEKEOxEXGlLzyQ4UfaJbcme6 | ||
ce1XR2bFuAJKZTRei9AqPCCcUZlM51Ke92sRKw2Sfh3oius2FkOH6ipjv3U/697E | ||
A7sKPPcw7+uvTPyLNhBzPvOk | ||
-----END CERTIFICATE----- |
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,35 @@ | ||
-----BEGIN CERTIFICATE----- | ||
MIIGATCCBOmgAwIBAgIQCh5LiVVv3nEde7Li3/+ATzANBgkqhkiG9w0BAQsFADBP | ||
MQswCQYDVQQGEwJ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END CERTIFICATE----- |
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,3 @@ | ||
V 300401030000Z 01 unknown = US, O = Sylabs Inc., CN = root | ||
V 300401030000Z 02 unknown = US, O = Sylabs Inc., CN = intermediate | ||
V 300401030000Z 03 unknown = US, O = Sylabs Inc., CN = leaf |
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,62 @@ | ||
// Copyright (c) 2022, Sylabs Inc. All rights reserved. | ||
// This software is licensed under a 3-clause BSD license. Please consult the LICENSE.md file | ||
// distributed with the sources of this project regarding your rights to use or distribute this | ||
// software. | ||
|
||
package ocspresponder | ||
|
||
import ( | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
) | ||
|
||
var DefaultOCSPResponderArgs = ResponderArgs{ | ||
IndexFile: "./index.txt", | ||
ServerPort: "9999", | ||
OCSPKeyPath: filepath.Join("..", "test", "keys", "ecdsa-private.pem"), // see test/gen_certs.go | ||
OCSPCertPath: filepath.Join("..", "test", "certs", "root.pem"), // see test/gen_certs.go | ||
CACertPath: filepath.Join("..", "test", "certs", "root.pem"), | ||
} | ||
|
||
// ResponderArgs specifies the arguments for the OCSP Responder. | ||
type ResponderArgs struct { | ||
// IndexFile is the Certificate status index file | ||
IndexFile string | ||
|
||
// ServerPort is the Port to run responder on. | ||
ServerPort string | ||
|
||
// OCSPKeyPath is the Responder key to sign responses with. | ||
OCSPKeyPath string | ||
|
||
// OCSPCertPath is the Responder certificate to sign responses with. | ||
OCSPCertPath string | ||
|
||
// CACertPath is CA certificate filename. | ||
CACertPath string | ||
} | ||
|
||
// StartOCSPResponder runs the OCSP responder. | ||
func StartOCSPResponder(args ResponderArgs) error { | ||
// ensure that the index file exists. | ||
// if not, create is using the ./add_cert_to_index.sh | ||
_, err := os.Stat(args.IndexFile) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
cmd := exec.Command("openssl", []string{ | ||
"ocsp", "-text", | ||
"-index", args.IndexFile, | ||
"-port", args.ServerPort, | ||
"-rsigner", args.OCSPCertPath, | ||
"-rkey", args.OCSPKeyPath, | ||
"-CA", args.CACertPath, | ||
}...) | ||
|
||
// cmd.Stdout = os.Stdout | ||
cmd.Stderr = os.Stderr | ||
|
||
return cmd.Run() | ||
} |
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,9 @@ | ||
#!/bin/sh | ||
|
||
# pass the path to the PEM-encoded certificate as first argument to the script, and then append to index.txt | ||
|
||
crt=$1 | ||
exp=$(date -d "$(openssl x509 -enddate -noout -in $crt | cut -d= -f 2)" +"%y%m%d%H%M%SZ") | ||
ser=$(openssl x509 -serial -noout -in $crt | cut -d= -f 2) | ||
sub=$(openssl x509 -subject -noout -in $crt | cut -d= -f 2- | cut -d' ' -f 2-) | ||
echo -e "V\t$exp\t\t$ser\tunknown\t$sub" |
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,15 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
|
||
"github.com/sylabs/singularity/e2e/verify/ocspresponder" | ||
) | ||
|
||
func main() { | ||
if err := ocspresponder.StartOCSPResponder(ocspresponder.DefaultOCSPResponderArgs); err != nil { | ||
fmt.Fprintln(os.Stderr, "Error:", err) | ||
os.Exit(1) | ||
} | ||
} |
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
Oops, something went wrong.