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

Method prepare_kx_groups

crates/stdlib/src/ssl.rs:3082–3098  ·  view source on GitHub ↗

Helper: Prepare KX groups (ECDH curve) from context settings

(
            &self,
            vm: &VirtualMachine,
        )

Source from the content-addressed store, hash-verified

3080
3081 /// Helper: Prepare KX groups (ECDH curve) from context settings
3082 fn prepare_kx_groups(
3083 &self,
3084 vm: &VirtualMachine,
3085 ) -> PyResult<Option<Vec<&'static dyn SupportedKxGroup>>> {
3086 let ctx = self.context.read();
3087 let ecdh_curve = ctx.ecdh_curve.read().clone();
3088 drop(ctx);
3089
3090 if let Some(ref curve_name) = ecdh_curve {
3091 match curve_name_to_kx_group(curve_name) {
3092 Ok(groups) => Ok(Some(groups)),
3093 Err(e) => Err(vm.new_value_error(format!("Failed to set ECDH curve: {e}"))),
3094 }
3095 } else {
3096 Ok(None)
3097 }
3098 }
3099
3100 /// Helper: Prepare all common protocol settings (versions, KX groups, ciphers, ALPN)
3101 fn prepare_protocol_settings(&self, vm: &VirtualMachine) -> PyResult<ProtocolSettings> {

Callers 1

Calls 5

curve_name_to_kx_groupFunction · 0.85
SomeClass · 0.50
ErrClass · 0.50
readMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected