Skip to content

Commit 505ab14

Browse files
Meroviusbradfitz
authored andcommitted
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 <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
1 parent eb0de9b commit 505ab14

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

openpgp/write.go

+2
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ func Encrypt(ciphertext io.Writer, to []*Entity, signed *Entity, hints *FileHint
271271
// These are the possible hash functions that we'll use for the signature.
272272
candidateHashes := []uint8{
273273
hashToHashId(crypto.SHA256),
274+
hashToHashId(crypto.SHA384),
274275
hashToHashId(crypto.SHA512),
275276
hashToHashId(crypto.SHA1),
276277
hashToHashId(crypto.RIPEMD160),
@@ -349,6 +350,7 @@ func Sign(output io.Writer, signed *Entity, hints *FileHints, config *packet.Con
349350
// These are the possible hash functions that we'll use for the signature.
350351
candidateHashes := []uint8{
351352
hashToHashId(crypto.SHA256),
353+
hashToHashId(crypto.SHA384),
352354
hashToHashId(crypto.SHA512),
353355
hashToHashId(crypto.SHA1),
354356
hashToHashId(crypto.RIPEMD160),

0 commit comments

Comments
 (0)