MCPcopy Index your code
hub / github.com/RustPython/RustPython / extract_cipher_info

Function extract_cipher_info

crates/stdlib/src/ssl/compat.rs:2347–2358  ·  view source on GitHub ↗

Extract cipher information from a rustls CipherSuite This consolidates the common cipher extraction logic used across get_ciphers(), cipher(), and shared_ciphers() methods.

(suite: &rustls::SupportedCipherSuite)

Source from the content-addressed store, hash-verified

2345/// This consolidates the common cipher extraction logic used across
2346/// get_ciphers(), cipher(), and shared_ciphers() methods.
2347pub(super) fn extract_cipher_info(suite: &rustls::SupportedCipherSuite) -> CipherInfo {
2348 let rustls_name = format!("{:?}", suite.suite());
2349 let name = normalize_rustls_cipher_name(&rustls_name);
2350 let protocol = get_protocol_version_str(suite.version());
2351 let bits = get_cipher_key_bits(&name);
2352
2353 CipherInfo {
2354 name,
2355 protocol,
2356 bits,
2357 }
2358}
2359
2360/// Convert curve name to rustls key exchange group
2361///

Callers 3

get_ciphersMethod · 0.85
cipherMethod · 0.85
shared_ciphersMethod · 0.85

Calls 4

get_protocol_version_strFunction · 0.85
get_cipher_key_bitsFunction · 0.85
versionMethod · 0.45

Tested by

no test coverage detected