From a039b7aff24af35ba8f23bb28a3f5785b66c69d6 Mon Sep 17 00:00:00 2001 From: Michael Tharp Date: Thu, 8 Mar 2018 15:05:53 +0000 Subject: [PATCH] Send interactive signing output to stderr --- Gopkg.lock | 8 ++++---- README.md | 1 + lib/x509tools/x509cmd.go | 14 +++++++------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 62862cb..7981076 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -114,7 +114,7 @@ branch = "master" name = "github.com/streadway/amqp" packages = ["."] - revision = "fc7fda2371f5327ad39211e09482845b8734cc72" + revision = "d27ae102b8892a98ca4edb74539436af62577379" [[projects]] branch = "master" @@ -147,7 +147,7 @@ "pkcs12/internal/rc2", "ssh/terminal" ] - revision = "91a49db82a88618983a78a06c1cbd4e00ab749ab" + revision = "85f98707c97e11569271e4d9b3d397e079c4f4d0" [[projects]] branch = "master" @@ -158,7 +158,7 @@ "idna", "lex/httplex" ] - revision = "22ae77b79946ea320088417e4d50825671d82d57" + revision = "07e8617a6db2368fa55d4616f371ee1b1403c817" [[projects]] branch = "master" @@ -172,7 +172,7 @@ "windows/svc/eventlog", "windows/svc/mgr" ] - revision = "dd2ff4accc098aceecb86b36eaa7829b2a17b1c9" + revision = "349b81fb5c64ec1734eb6ee148df25459ea48517" [[projects]] name = "golang.org/x/text" diff --git a/README.md b/README.md index 6b97f5d..2e5504c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Other features include: * Generating and importing keys in the token * Importing certificate chains from a PKCS#12 file * Creating X509 certificate signing requests (CSR) and self-signed certificates +* Limited X509 CA support -- signing CSRs and cross-signing certificates * Creating simple PGP public keys * RSA and ECDSA supported for all signature types * Verify signatures, certificate chains and timestamps on all supported package types diff --git a/lib/x509tools/x509cmd.go b/lib/x509tools/x509cmd.go index 4a51458..56e88fc 100644 --- a/lib/x509tools/x509cmd.go +++ b/lib/x509tools/x509cmd.go @@ -286,10 +286,10 @@ func confirmAndCreate(template, parent *x509.Certificate, pub crypto.PublicKey, if err != nil { return nil, err } - fmt.Println("Signing certificate:") - fmt.Println() - FprintCertificate(os.Stdout, cert) - fmt.Println() + fmt.Fprintln(os.Stderr, "Signing certificate:") + fmt.Fprintln(os.Stderr) + FprintCertificate(os.Stderr, cert) + fmt.Fprintln(os.Stderr) if !promptYN("Sign this cert? [Y/n] ") { fmt.Fprintln(os.Stderr, "operation canceled") os.Exit(2) @@ -299,14 +299,14 @@ func confirmAndCreate(template, parent *x509.Certificate, pub crypto.PublicKey, } func promptYN(prompt string) bool { - fmt.Print(prompt) + fmt.Fprint(os.Stderr, prompt) if !terminal.IsTerminal(0) { - fmt.Println("input is not a terminal, assuming true") + fmt.Fprintln(os.Stderr, "input is not a terminal, assuming true") return true } state, err := terminal.MakeRaw(0) if err == nil { - defer fmt.Println() + defer fmt.Fprintln(os.Stderr) defer terminal.Restore(0, state) } var d [1]byte