MCPcopy Create free account
hub / github.com/crewjam/saml / verifySimpleSignSignature

Method verifySimpleSignSignature

simplesign_binding.go:176–191  ·  view source on GitHub ↗

verifySimpleSignSignature checks the SimpleSign signature of m against the IDP's signing certificates, chosen as for HTTP-Redirect binding signatures (see redirectBindingCerts). With a fingerprint-only configuration the certificate is taken from the KeyInfo form control and must match the configured

(m *simpleSignMessage)

Source from the content-addressed store, hash-verified

174// control is ignored: the signature is only ever checked against trusted
175// certificates.
176func (sp *ServiceProvider) verifySimpleSignSignature(m *simpleSignMessage) error {
177 if err := checkSigAlgNotSHA1(sp.RejectSHA1Signatures, m.SigAlg); err != nil {
178 return err
179 }
180 algorithm, signature, err := decodeDetachedSignature(m.SigAlg, m.Signature, simpleSignBase64)
181 if err != nil {
182 return err
183 }
184
185 certs, err := sp.simpleSignCerts(m)
186 if err != nil {
187 return fmt.Errorf("cannot validate signature: %w", err)
188 }
189
190 return checkDetachedSignature(algorithm, m.signedContent(), signature, certs, sp.dsigClock().Now(), sp.IgnoreCertificateExpiry)
191}
192
193// simpleSignCerts returns the IDP certificates that may have produced the
194// SimpleSign signature of m.

Callers 2

readSimpleSignMessageMethod · 0.95

Calls 6

simpleSignCertsMethod · 0.95
dsigClockMethod · 0.95
checkSigAlgNotSHA1Function · 0.85
decodeDetachedSignatureFunction · 0.85
checkDetachedSignatureFunction · 0.85
signedContentMethod · 0.80

Tested by

no test coverage detected