From 505ab145d0a99da450461ae2c1a9f6cd10d1f447 Mon Sep 17 00:00:00 2001 From: Axel Wagner Date: Thu, 27 Sep 2018 00:07:39 +0200 Subject: [PATCH] openpgp: support SHA384 SHA384 is a natural hashing choice for P-384 ECDSA. The only thing needed to make it usable, is adding it to the list of candidates. Change-Id: I61f66f371774f95dfc1de30d10fab66f92c21b6b Reviewed-on: https://go-review.googlesource.com/c/137956 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot --- openpgp/write.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openpgp/write.go b/openpgp/write.go index d6dede7..4ee7178 100644 --- a/openpgp/write.go +++ b/openpgp/write.go @@ -271,6 +271,7 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint // These are the possible hash functions that we'll use for the signature. candidateHashes := []uint8{ hashToHashId(crypto.SHA256), + hashToHashId(crypto.SHA384), hashToHashId(crypto.SHA512), hashToHashId(crypto.SHA1), hashToHashId(crypto.RIPEMD160), @@ -349,6 +350,7 @@ func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Con // These are the possible hash functions that we'll use for the signature. candidateHashes := []uint8{ hashToHashId(crypto.SHA256), + hashToHashId(crypto.SHA384), hashToHashId(crypto.SHA512), hashToHashId(crypto.SHA1), hashToHashId(crypto.RIPEMD160),