From 729f1e841bcca28c2cd9f4034d6f7672604dbeda Mon Sep 17 00:00:00 2001 From: Lily Chung Date: Sun, 26 Apr 2020 17:01:02 -0700 Subject: [PATCH] ssh: improve docs on Certificate.SignCert Document the fact that SignCert sets the Nonce field. This makes it clear that callers need not set it themselves. Original change by Jakob Weisblat in CL 57051. Fixes golang/go#21384 Change-Id: I161e0909ba6c8d07be5f8e68dc6e0f0392bea63f Reviewed-on: https://go-review.googlesource.com/c/crypto/+/230212 Reviewed-by: Filippo Valsorda --- ssh/certs.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssh/certs.go b/ssh/certs.go index 0f89aec..916c840 100644 --- a/ssh/certs.go +++ b/ssh/certs.go @@ -414,8 +414,8 @@ func (c *CertChecker) CheckCert(principal string, cert *Certificate) error { return nil } -// SignCert sets c.SignatureKey to the authority's public key and stores a -// Signature, by authority, in the certificate. +// SignCert signs the certificate with an authority, setting the Nonce, +// SignatureKey, and Signature fields. func (c *Certificate) SignCert(rand io.Reader, authority Signer) error { c.Nonce = make([]byte, 32) if _, err := io.ReadFull(rand, c.Nonce); err != nil {