MCPcopy
hub / github.com/mozilla/cipherscan / conf_iterator

Function conf_iterator

cscan.py:128–144  ·  view source on GitHub ↗

Caching, selecting iterator over configs. Returns an iterator that will go over configs that match the provided predicate (a function that returns true or false depending if given config is ok for test at hand) while saving the results to the cache/verbose `

(predicate)

Source from the content-addressed store, hash-verified

126 hostname))
127
128 def conf_iterator(predicate):
129 """
130 Caching, selecting iterator over configs.
131
132 Returns an iterator that will go over configs that match the provided
133 predicate (a function that returns true or false depending if given
134 config is ok for test at hand) while saving the results to the
135 cache/verbose `results` log/dictionary
136
137 The iterator returns False for every connection that succeeded
138 (meaning the server is NOT intolerant to config and True to mean
139 that server IS intolerant to config.
140 """
141 scan_iter = (not simple_inspector(result_cache(name, conf))
142 for name, conf in configs.items()
143 if predicate(conf))
144 return itertools.chain(result_iterator(predicate), scan_iter)
145
146 host_up = not all(conf_iterator(lambda conf: True))
147

Callers 1

scan_TLS_intoleranciesFunction · 0.85

Calls 3

simple_inspectorFunction · 0.85
result_cacheFunction · 0.85
result_iteratorFunction · 0.85

Tested by

no test coverage detected