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)
| 174 | // control is ignored: the signature is only ever checked against trusted |
| 175 | // certificates. |
| 176 | func (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. |
no test coverage detected