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

Function cipher_description

crates/stdlib/src/openssl.rs:3968–3984  ·  view source on GitHub ↗
(cipher: *const sys::SSL_CIPHER)

Source from the content-addressed store, hash-verified

3966 }
3967
3968 fn cipher_description(cipher: *const sys::SSL_CIPHER) -> String {
3969 unsafe {
3970 // SSL_CIPHER_description writes up to 128 bytes
3971 let mut buf = vec![0u8; 256];
3972 let result = sys::SSL_CIPHER_description(
3973 cipher,
3974 buf.as_mut_ptr() as *mut libc::c_char,
3975 buf.len() as i32,
3976 );
3977 if result.is_null() {
3978 return String::from("No description available");
3979 }
3980 // Find the null terminator
3981 let len = buf.iter().position(|&c| c == 0).unwrap_or(buf.len());
3982 String::from_utf8_lossy(&buf[..len]).trim().to_string()
3983 }
3984 }
3985
3986 impl Read for SocketStream {
3987 fn read(&mut self, buf: &mut [u8]) -> std::io::Result<usize> {

Callers 1

get_ciphersMethod · 0.85

Calls 6

as_mut_ptrMethod · 0.80
to_stringMethod · 0.80
trimMethod · 0.80
lenMethod · 0.45
positionMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected