From 2a3e87afff95f127e17de602879881d17cc7e67c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20M=C3=B6hlmann?= Date: Tue, 20 Aug 2024 10:44:45 +0300 Subject: [PATCH] update code comment --- pkg/crypto/hash.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/crypto/hash.go b/pkg/crypto/hash.go index 552d769..14acdee 100644 --- a/pkg/crypto/hash.go +++ b/pkg/crypto/hash.go @@ -22,12 +22,10 @@ func GetHashAlgorithm(sigAlgorithm jose.SignatureAlgorithm) (hash.Hash, error) { case jose.RS512, jose.ES512, jose.PS512: return sha512.New(), nil - // There is no published spec for this yet. + // There is no published spec for this yet, but we have confirmation it will get published. // There is consensus here: https://bitbucket.org/openid/connect/issues/1125/_hash-algorithm-for-eddsa-id-tokens - // Currently go-jose only supports the ed25519 curve key for EdDSA, so we can safely assume sha512 here. - // - // TODO: When go-jose ever decides to support ed448, we need to know the "crv" parameter and use shake256 for ed448. - // The "crv" value is currently not exposed by go-jose.JSONWebKey and is currently only hard-coded to be set during marshalling. + // Currently Go and go-jose only supports the ed25519 curve key for EdDSA, so we can safely assume sha512 here. + // It is unlikely ed448 will ever be supported: https://github.com/golang/go/issues/29390 case jose.EdDSA: return sha512.New(), nil