ct-test-srv should print the logID (#6475)

When using `ct-test-srv` with Boulder infrastructure, it's important now
that the logIDs are correctly configured. This is a nice-to-have that
prints the logID for the provided EC privkey on startup, the same way
that `ct-test-srv` prints the EC pubkey.
This commit is contained in:
J.C. Jones 2022-10-27 18:02:56 -07:00 committed by GitHub
parent f246ca10ba
commit c791075e00
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -5,6 +5,7 @@ package main
import (
"crypto/ecdsa"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"encoding/json"
@ -234,8 +235,9 @@ func runPersonality(p Personality) {
Addr: p.Addr,
Handler: m,
}
log.Printf("ct-test-srv on %s with pubkey %s", p.Addr,
base64.StdEncoding.EncodeToString(pubKeyBytes))
logID := sha256.Sum256(pubKeyBytes)
log.Printf("ct-test-srv on %s with pubkey %s and log ID %s", p.Addr,
base64.StdEncoding.EncodeToString(pubKeyBytes), base64.StdEncoding.EncodeToString(logID[:]))
log.Fatal(srv.ListenAndServe())
}