forked from sigstore/cosign
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add '--cert-identity' flag to support subject alternate names for ver… (
sigstore#2278) * Add '--cert-identity' flag to support subject alternate names for verification. Signed-off-by: kpk47 <[email protected]> * Fixing documentation Signed-off-by: kpk47 <[email protected]> * fix e2e test Signed-off-by: kpk47 <[email protected]> * Add '--cert-identity' flag to support subject alternate names for verification. Signed-off-by: kpk47 <[email protected]> * Fixing documentation Signed-off-by: kpk47 <[email protected]> * fix e2e test Signed-off-by: kpk47 <[email protected]> * fix unit test Signed-off-by: kpk47 <[email protected]> Signed-off-by: kpk47 <[email protected]>
- Loading branch information
Showing
15 changed files
with
209 additions
and
23 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
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
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
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 |
---|---|---|
|
@@ -721,6 +721,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -765,6 +766,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
"", /*certEmail*/ | ||
"", /*certIdentity*/ | ||
"", /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -803,6 +805,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
"", /*certEmail*/ | ||
"", /*certIdentity*/ | ||
"", /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -841,6 +844,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
"", /*certEmail*/ | ||
"", /*certIdentity*/ | ||
"", /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -879,6 +883,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
"", /*certEmail*/ | ||
"", /*certIdentity*/ | ||
"", /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -917,6 +922,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
"[email protected]", /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -925,7 +931,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
"", "", "", "", "", | ||
// GitHub identity flags end | ||
false /*enforceSCT*/) | ||
if err == nil || !strings.Contains(err.Error(), "expected email not found in certificate") { | ||
if err == nil || !strings.Contains(err.Error(), "expected identity not found in certificate") { | ||
t.Fatalf("expected error with mismatched identity, got %v", err) | ||
} | ||
}) | ||
|
@@ -955,6 +961,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Cert is fetched from bundle | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
"invalid", /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -994,6 +1001,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
certPath, /*certRef*/ | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -1032,6 +1040,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
os.Getenv("SIGSTORE_ROOT_FILE"), /*certChain*/ | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -1081,6 +1090,7 @@ func TestVerifyBlobCmdWithBundle(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
tmpChainFile.Name(), /*certChain*/ | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -1126,6 +1136,7 @@ func TestVerifyBlobCmdInvalidRootCA(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
certPath, /*certRef*/ | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
@@ -1164,6 +1175,7 @@ func TestVerifyBlobCmdInvalidRootCA(t *testing.T) { | |
options.KeyOpts{BundlePath: bundlePath}, | ||
"", /*certRef*/ // Fetched from bundle | ||
identity, /*certEmail*/ | ||
"", /*certIdentity*/ | ||
issuer, /*certOidcIssuer*/ | ||
"", /*certChain*/ // Chain is fetched from TUF/SIGSTORE_ROOT_FILE | ||
"", /*sigRef*/ // Sig is fetched from bundle | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.