[go] crypto/x509: add SignatureAlgorithm.Hash()

26 views
Skip to first unread message

Gerrit Bot (Gerrit)

unread,
Jul 27, 2019, 6:04:10 AM7/27/19
to Ian Lance Taylor, Filippo Valsorda, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Gerrit Bot has uploaded this change for review.

View Change

crypto/x509: add SignatureAlgorithm.Hash()

Add method to return the hashing algorithm associated with a
certificates signature algorithm. This is useful when generating TLS
channel bindings as documented in RFC 5929.

Fixes #33317

Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
GitHub-Last-Rev: 4a4c23d3af176455c648639e37d4b1c49c3df7df
GitHub-Pull-Request: golang/go#33318
---
M src/crypto/x509/x509.go
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/crypto/x509/x509.go b/src/crypto/x509/x509.go
index 1cd8fde..4798ec8 100644
--- a/src/crypto/x509/x509.go
+++ b/src/crypto/x509/x509.go
@@ -219,6 +219,15 @@
return strconv.Itoa(int(algo))
}

+func (algo SignatureAlgorithm) Hash() crypto.Hash {
+ for _, details := range signatureAlgorithmDetails {
+ if details.algo == algo {
+ return details.hash
+ }
+ }
+ return crypto.Hash(0)
+}
+
type PublicKeyAlgorithm int

const (

To view, visit change 187778. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
Gerrit-Change-Number: 187778
Gerrit-PatchSet: 1
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-MessageType: newchange

Gobot Gobot (Gerrit)

unread,
Jul 27, 2019, 6:04:25 AM7/27/19
to Gerrit Bot, goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.

View Change

    To view, visit change 187778. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
    Gerrit-Change-Number: 187778
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-CC: Gobot Gobot <go...@golang.org>
    Gerrit-Comment-Date: Sat, 27 Jul 2019 10:04:22 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: No
    Gerrit-MessageType: comment

    Gopher Robot (Gerrit)

    unread,
    Dec 15, 2021, 2:20:15 PM12/15/21
    to Gerrit Dou, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, golang-co...@googlegroups.com

    Gopher Robot abandoned this change.

    View Change

    Abandoned GitHub PR golang/go#33318 has been closed.

    To view, visit change 187778. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
    Gerrit-Change-Number: 187778
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-MessageType: abandon

    Heschi Kreinick (Gerrit)

    unread,
    Dec 15, 2021, 8:41:37 PM12/15/21
    to Gerrit Dou, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, Gopher Robot, golang-co...@googlegroups.com

    Heschi Kreinick restored this change.

    View Change

    To view, visit change 187778. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
    Gerrit-Change-Number: 187778
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Dou <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-MessageType: restore

    Gopher Robot (Gerrit)

    unread,
    Sep 28, 2022, 6:11:38 PM9/28/22
    to Gerrit Bot, goph...@pubsubhelper.golang.org, Filippo Valsorda, Adam Langley, Russ Cox, golang-co...@googlegroups.com

    Gopher Robot abandoned this change.

    View Change

    Abandoned GitHub PR golang/go#33318 has been closed.

    To view, visit change 187778. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: go
    Gerrit-Branch: master
    Gerrit-Change-Id: Ib9d9cbca4a33d0e46fad4df1ee02a62d1514b254
    Gerrit-Change-Number: 187778
    Gerrit-PatchSet: 1
    Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
    Gerrit-Reviewer: Filippo Valsorda <fil...@golang.org>
    Gerrit-CC: Adam Langley <a...@golang.org>
    Gerrit-CC: Gopher Robot <go...@golang.org>
    Gerrit-CC: Russ Cox <r...@golang.org>
    Gerrit-MessageType: abandon
    Reply all
    Reply to author
    Forward
    0 new messages