Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Zheng <patrickzheng@microsoft.com>
  • Loading branch information
Two-Hearts committed May 8, 2024
1 parent 366a2cb commit ec1725d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions token.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ func (t *SignedToken) GetSigningCertificate(signerInfo *cms.SignerInfo) (*x509.C
var hashFunc crypto.Hash
var expectedCertHash []byte
if useSigningCertificate {
// Reference: https://datatracker.ietf.org/doc/html/rfc2634#section-5.4.1
hashFunc = crypto.SHA1
expectedCertHash = signingCertificate.Certificates[0].CertHash
} else {
// Reference: https://datatracker.ietf.org/doc/html/rfc5035#section-4
hashFunc = crypto.SHA256 // default hash algorithm for signingCertificateV2 is id-sha256
var ok bool
if signingCertificateV2.Certificates[0].HashAlgorithm.Algorithm != nil {
Expand Down

0 comments on commit ec1725d

Please sign in to comment.