Commit f1e06b5c authored by Kunihiko Sakamoto's avatar Kunihiko Sakamoto Committed by Commit Bot

Signed Exchange: Update generate-test-sxgs.sh to use -sctDir

gen-certurl's -sct option is deprecated in
https://github.com/WICG/webpackage/pull/259.

Bug: 803774
Change-Id: I4fbc575366aba978b262418d2cf415121e840099
Reviewed-on: https://chromium-review.googlesource.com/1154745
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Reviewed-by: default avatarKouhei Ueno <kouhei@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578999}
parent 16edd274
...@@ -48,7 +48,12 @@ const int kOutputBufferSize = 4096; ...@@ -48,7 +48,12 @@ const int kOutputBufferSize = 4096;
// "wildcard_example.org.public.pem.cbor" has these dummy data in "ocsp" and // "wildcard_example.org.public.pem.cbor" has these dummy data in "ocsp" and
// "sct" fields. // "sct" fields.
constexpr base::StringPiece kDummyOCSPDer = "OCSP"; constexpr base::StringPiece kDummyOCSPDer = "OCSP";
constexpr base::StringPiece kDummySCTList = "SCT"; constexpr char kDummySCTBytes[] = {
0x00, 0x05, // Length of the sct list
0x00, 0x03, 'S', 'C', 'T' // List entry: length and body
};
constexpr base::StringPiece kDummySCTList(kDummySCTBytes,
sizeof(kDummySCTBytes));
std::string GetTestFileContents(base::StringPiece name) { std::string GetTestFileContents(base::StringPiece name) {
base::FilePath path; base::FilePath path;
......
...@@ -15,18 +15,20 @@ for cmd in gen-signedexchange gen-certurl dump-signedexchange; do ...@@ -15,18 +15,20 @@ for cmd in gen-signedexchange gen-certurl dump-signedexchange; do
done done
tmpdir=$(mktemp -d) tmpdir=$(mktemp -d)
sctdir=$tmpdir/scts
mkdir $sctdir
# Make dummy OCSP and SCT data for cbor certificate chains. # Make dummy OCSP and SCT data for cbor certificate chains.
echo -n OCSP >$tmpdir/ocsp; echo -n SCT >$tmpdir/sct echo -n OCSP >$tmpdir/ocsp; echo -n SCT >$sctdir/dummy.sct
# Generate the certificate chain of "*.example.org". # Generate the certificate chain of "*.example.org".
gen-certurl -pem prime256v1-sha256.public.pem \ gen-certurl -pem prime256v1-sha256.public.pem \
-ocsp $tmpdir/ocsp -sct $tmpdir/sct > test.example.org.public.pem.cbor -ocsp $tmpdir/ocsp -sctDir $sctdir > test.example.org.public.pem.cbor
# Generate the certificate chain of "*.example.org", without # Generate the certificate chain of "*.example.org", without
# CanSignHttpExchangesDraft extension. # CanSignHttpExchangesDraft extension.
gen-certurl -pem prime256v1-sha256-noext.public.pem \ gen-certurl -pem prime256v1-sha256-noext.public.pem \
-ocsp $tmpdir/ocsp -sct $tmpdir/sct > test.example.org-noext.public.pem.cbor -ocsp $tmpdir/ocsp -sctDir $sctdir > test.example.org-noext.public.pem.cbor
# Generate the signed exchange file. # Generate the signed exchange file.
gen-signedexchange \ gen-signedexchange \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment