(n: i32, vm: &VirtualMachine)
| 513 | |
| 514 | #[pyfunction(name = "RAND_bytes")] |
| 515 | fn rand_bytes(n: i32, vm: &VirtualMachine) -> PyResult<Vec<u8>> { |
| 516 | if n < 0 { |
| 517 | return Err(vm.new_value_error("num must be positive")); |
| 518 | } |
| 519 | let mut buf = vec![0; n as usize]; |
| 520 | openssl::rand::rand_bytes(&mut buf).map_err(|e| convert_openssl_error(vm, e))?; |
| 521 | Ok(buf) |
| 522 | } |
| 523 | |
| 524 | // Callback data stored in SSL ex_data for SNI/msg callbacks |
| 525 | struct SniCallbackData { |
nothing calls this directly
no test coverage detected