Bläddra i källkod

x/crypto/openpgp/packet: fix message for errors resulting from an unknown cipher.

Change-Id: Icebde4a001b220a64aa4bcddd206484feed5ad79
Reviewed-on: https://go-review.googlesource.com/15155
Reviewed-by: Andrew Gerrand <adg@golang.org>
Adam Langley 10 år sedan
förälder
incheckning
b270509459
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      openpgp/packet/symmetric_key_encrypted.go

+ 1 - 1
openpgp/packet/symmetric_key_encrypted.go

@@ -85,7 +85,7 @@ func (ske *SymmetricKeyEncrypted) Decrypt(passphrase []byte) ([]byte, CipherFunc
 	c.XORKeyStream(plaintextKey, ske.encryptedKey)
 	cipherFunc := CipherFunction(plaintextKey[0])
 	if cipherFunc.blockSize() == 0 {
-		return nil, ske.CipherFunc, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(ske.CipherFunc)))
+		return nil, ske.CipherFunc, errors.UnsupportedError("unknown cipher: " + strconv.Itoa(int(cipherFunc)))
 	}
 	plaintextKey = plaintextKey[1:]
 	if l := len(plaintextKey); l == 0 || l%cipherFunc.blockSize() != 0 {