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

Function decryptForFuzzing

xmlenc/fuzz_coverage_test.go:122–132  ·  view source on GitHub ↗

decryptForFuzzing parses data as XML and decrypts its root element with key. It is what the fuzz tests exercise.

(key *rsa.PrivateKey, data []byte)

Source from the content-addressed store, hash-verified

120// decryptForFuzzing parses data as XML and decrypts its root element with
121// key. It is what the fuzz tests exercise.
122func decryptForFuzzing(key *rsa.PrivateKey, data []byte) error {
123 doc := etree.NewDocument()
124 if err := doc.ReadFromBytes(data); err != nil {
125 return err
126 }
127 if doc.Root() == nil {
128 return ErrCannotFindRequiredElement("root element")
129 }
130 _, err := Decrypt(key, doc.Root())
131 return err
132}
133
134// FuzzDecrypt fuzzes Decrypt with hostile documents, seeded with the corpus
135// and past crashers of the retired go-fuzz harness. Run it with

Callers 3

TestCovFuzzFunction · 0.85
FuzzDecryptFunction · 0.85

Calls 2

DecryptFunction · 0.85

Tested by

no test coverage detected