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:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user