MCPcopy Index your code
hub / github.com/mozilla/cipherscan / simple_inspector

Function simple_inspector

cscan.py:37–54  ·  view source on GitHub ↗

Perform simple check to see if connection was successful. Returns True is connection was successful, server replied with ServerHello and ServerHelloDone messages, and the cipher selected was present in ciphers advertised by client, False otherwise

(result)

Source from the content-addressed store, hash-verified

35
36
37def simple_inspector(result):
38 """
39 Perform simple check to see if connection was successful.
40
41 Returns True is connection was successful, server replied with
42 ServerHello and ServerHelloDone messages, and the cipher selected
43 was present in ciphers advertised by client, False otherwise
44 """
45 if any(isinstance(x, ServerHelloDone) for x in result):
46 ch = next((x for x in result if isinstance(x, ClientHello)), None)
47 sh = next((x for x in result if isinstance(x, ServerHello)), None)
48 if ch and sh:
49 if sh.cipher_suite not in ch.cipher_suites:
50 # FAILURE cipher suite mismatch
51 return False
52 return True
53 # incomplete response or error
54 return False
55
56
57def verbose_inspector(desc, result):

Callers 2

result_iteratorFunction · 0.85
conf_iteratorFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected