diff options
author | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-09-13 13:26:06 +0200 |
---|---|---|
committer | Rasmus Dahlberg <rasmus.dahlberg@kau.se> | 2021-09-13 13:26:06 +0200 |
commit | 33e199c9939e110bd677e7b3e43547c6e55bb6e2 (patch) | |
tree | 7587ba4cc0faed4bf56eba4bbcc1020c27bd981e /cmd | |
parent | b12bbcfb850542d92275d1e0a65aac641c30a1ee (diff) |
fixed {st,stfe,system-transparency} -> sigsum
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/sigsum_log_go/.gitignore (renamed from cmd/siglog_server/.gitignore) | 0 | ||||
-rw-r--r-- | cmd/sigsum_log_go/README.md (renamed from cmd/siglog_server/README.md) | 33 | ||||
-rw-r--r-- | cmd/sigsum_log_go/main.go (renamed from cmd/siglog_server/main.go) | 23 | ||||
-rw-r--r-- | cmd/tmp/cosign/main.go | 6 | ||||
-rw-r--r-- | cmd/tmp/submit/main.go | 4 |
5 files changed, 32 insertions, 34 deletions
diff --git a/cmd/siglog_server/.gitignore b/cmd/sigsum_log_go/.gitignore index 254defd..254defd 100644 --- a/cmd/siglog_server/.gitignore +++ b/cmd/sigsum_log_go/.gitignore diff --git a/cmd/siglog_server/README.md b/cmd/sigsum_log_go/README.md index 71bb3ac..5e419ba 100644 --- a/cmd/siglog_server/README.md +++ b/cmd/sigsum_log_go/README.md @@ -1,11 +1,11 @@ -# Run Trillian + STFE locally +# Run Trillian + sigsum-log-go locally Trillian uses a database. So, we will need to set that up. It is documented [here](https://github.com/google/trillian#mysql-setup), and how to check that it is setup properly [here](https://github.com/google/certificate-transparency-go/blob/master/trillian/docs/ManualDeployment.md#data-storage). -Other than the database we need the Trillian log signer, Trillian log server, -and STFE server. +Other than the database we need Trillian log signer, Trillian log server, and +sigsum-log-go. ``` $ go install github.com/google/trillian/cmd/trillian_log_signer $ go install github.com/google/trillian/cmd/trillian_log_server @@ -31,30 +31,27 @@ $ createtree --admin_server localhost:6962 <tree id> ``` -Hang on to `<tree id>`. Our STFE server will use it when talking to the -Trillian log server to specify which Merkle tree we are working against. +Hang on to `<tree id>`. Our sigsum-log-go instance will use it when talking to +the Trillian log server to specify which Merkle tree we are working against. (If you take a look in the `Trees` table you will see that the tree has been provisioned.) -We will also need a public key-pair and log identifier for the STFE server. +We will also need a public key-pair for sigsum-log-go. ``` -$ go install github.com/system-transparency/stfe/types/cmd/new-namespace +$ go install golang.sigsum.org/sigsum-log-go/cmd/tmp/keygen +$ ./keygen sk: <sk> vk: <vk> -ed25519_v1: <namespace> ``` -The log's identifier is `<namespace>` and contains the public verification key -`<vk>`. The log's corresponding secret signing key is `<sk>`. - -Start STFE server: +Start sigsum-log-go: ``` -$ ./server --logtostderr -v 9 --http_endpoint localhost:6965 --log_rpc_server localhost:6962 --trillian_id <tree id> --key <sk> +$ tree_id=<tree_id> +$ sk=<sk> +$ sigsum_log_go --logtostderr -v 9 --http_endpoint localhost:6965 --log_rpc_server localhost:6962 --trillian_id $tree_id --key $sk ``` -If the log is responsive on, e.g., `GET http://localhost:6965/st/v1/get-latest-sth` you -may want to try running -`github.com/system-transparency/stfe/client/cmd/example.sh`. You need to -configure the log's id though for verification to work (flag `log_id`, which -should be set to the `<namespace>` output above). +Quick test: +- curl http://localhost:6965/sigsum/v0/get-tree-head-latest +- try `submit` and `cosign` commands in `cmd/tmp` diff --git a/cmd/siglog_server/main.go b/cmd/sigsum_log_go/main.go index 368b0a7..6189b1d 100644 --- a/cmd/siglog_server/main.go +++ b/cmd/sigsum_log_go/main.go @@ -1,4 +1,4 @@ -// Package main provides an STFE server binary +// Package main provides a sigsum-log-go binary package main import ( @@ -19,17 +19,18 @@ import ( "github.com/golang/glog" "github.com/google/trillian" "github.com/prometheus/client_golang/prometheus/promhttp" - stfe "github.com/system-transparency/stfe/pkg/instance" - "github.com/system-transparency/stfe/pkg/state" - trillianWrapper "github.com/system-transparency/stfe/pkg/trillian" - "github.com/system-transparency/stfe/pkg/types" "google.golang.org/grpc" + + sigsum "golang.sigsum.org/sigsum-log-go/pkg/instance" + "golang.sigsum.org/sigsum-log-go/pkg/state" + trillianWrapper "golang.sigsum.org/sigsum-log-go/pkg/trillian" + "golang.sigsum.org/sigsum-log-go/pkg/types" ) var ( - httpEndpoint = flag.String("http_endpoint", "localhost:6965", "host:port specification of where stfe serves clients") + httpEndpoint = flag.String("http_endpoint", "localhost:6965", "host:port specification of where sigsum-log-go serves clients") rpcBackend = flag.String("log_rpc_server", "localhost:6962", "host:port specification of where Trillian serves clients") - prefix = flag.String("prefix", "", "a prefix that proceeds /st/v0/<endpoint>") + prefix = flag.String("prefix", "", "a prefix that proceeds /sigsum/v0/<endpoint>") trillianID = flag.Int64("trillian_id", 0, "log identifier in the Trillian database") deadline = flag.Duration("deadline", time.Second*10, "deadline for backend requests") key = flag.String("key", "", "hex-encoded Ed25519 signing key") @@ -48,7 +49,7 @@ func main() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - glog.V(3).Infof("configuring stfe instance...") + glog.V(3).Infof("configuring sigsum-log-go instance...") instance, err := setupInstanceFromFlags() if err != nil { glog.Errorf("setupInstance: %v", err) @@ -83,9 +84,9 @@ func main() { } } -// SetupInstance sets up a new STFE instance from flags -func setupInstanceFromFlags() (*stfe.Instance, error) { - var i stfe.Instance +// SetupInstance sets up a new sigsum-log-go instance from flags +func setupInstanceFromFlags() (*sigsum.Instance, error) { + var i sigsum.Instance var err error // Setup log configuration diff --git a/cmd/tmp/cosign/main.go b/cmd/tmp/cosign/main.go index a51f17d..629e7ac 100644 --- a/cmd/tmp/cosign/main.go +++ b/cmd/tmp/cosign/main.go @@ -9,11 +9,11 @@ import ( "log" "net/http" - "github.com/system-transparency/stfe/pkg/types" + "golang.sigsum.org/sigsum-log-go/pkg/types" ) var ( - url = flag.String("url", "http://localhost:6965/st/v0", "base url") + url = flag.String("url", "http://localhost:6965/sigsum/v0", "base url") sk = flag.String("sk", "e1d7c494dacb0ddf809a17e4528b01f584af22e3766fa740ec52a1711c59500d711090dd2286040b50961b0fe09f58aa665ccee5cb7ee042d819f18f6ab5046b", "hex key") ) @@ -48,7 +48,7 @@ func main() { if err := sigident.MarshalASCII(buf); err != nil { log.Fatalf("MarshalASCII: %v", err) } - rsp, err = http.Post(*url+"/add-cosignature", "type/stfe", buf) + rsp, err = http.Post(*url+"/add-cosignature", "type/sigsum", buf) if err != nil { log.Fatalf("Post: %v", err) } diff --git a/cmd/tmp/submit/main.go b/cmd/tmp/submit/main.go index 3dcaa97..43fd457 100644 --- a/cmd/tmp/submit/main.go +++ b/cmd/tmp/submit/main.go @@ -7,7 +7,7 @@ import ( "crypto/rand" "fmt" - "github.com/system-transparency/stfe/pkg/types" + "golang.sigsum.org/sigsum-log-go/pkg/types" ) func main() { @@ -25,5 +25,5 @@ func main() { sig := ed25519.Sign(sk, msg.Marshal()) //fmt.Printf("sk: %x\nvk: %x\n", sk[:], vk[:]) - fmt.Printf("echo \"shard_hint=%d\nchecksum=%x\nsignature_over_message=%x\nverification_key=%x\ndomain_hint=%s\" | curl --data-binary @- localhost:6965/st/v0/add-leaf\n", msg.ShardHint, msg.Checksum[:], sig, vk[:], "example.com") + fmt.Printf("echo \"shard_hint=%d\nchecksum=%x\nsignature=%x\nverification_key=%x\ndomain_hint=%s\" | curl --data-binary @- localhost:6965/sigsum/v0/add-leaf\n", msg.ShardHint, msg.Checksum[:], sig, vk[:], "example.com") } |