openpgp: fix error strings and typos.

Fixes golang/go#2841.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5688054
This commit is contained in:
Adam Langley
2012-02-21 09:52:37 -05:00
parent ae4d10368a
commit 63736bd2bf
3 changed files with 11 additions and 11 deletions
+1 -2
View File
@@ -12,8 +12,7 @@ import (
)
// Config collects a number of parameters along with sensible defaults.
// A nil *Config is valid and produces all default values.
// A nil *Config is valid and results in all default values.
type Config struct {
// Rand provides the source of entropy.
// If nil, the crypto/rand Reader is used.
+3 -2
View File
@@ -483,13 +483,14 @@ func (sig *Signature) SignKey(pub *PublicKey, priv *PrivateKey, config *Config)
return sig.Sign(h, priv, config)
}
// Serialize marshals sig to w. SignRSA or SignDSA must have been called first.
// Serialize marshals sig to w. Sign, SignUserId or SignKey must have been
// called first.
func (sig *Signature) Serialize(w io.Writer) (err error) {
if len(sig.outSubpackets) == 0 {
sig.outSubpackets = sig.rawSubpackets
}
if sig.RSASignature.bytes == nil && sig.DSASigR.bytes == nil {
return errors.InvalidArgumentError("Signature: need to call SignRSA or SignDSA before Serialize")
return errors.InvalidArgumentError("Signature: need to call Sign, SignUserId or SignKey before Serialize")
}
sigLength := 0