Benign rust 7 installs Download

turbine-cli 0.1.2

“TURBINE command-line interface and daemon (binary name: turbine)”

Basename is uppercase README.mdContains an unbounded block loop
SHA-25630868e4078a3d989f3ef8c04d74fcf78fbe975c708913a358863575c62ee57b7
MaleculeH₂(CmF)

Evidence

imports std::fs lines 1–34
1use futures::join;
2use lazy_static::lazy_static;
3use native_tls::{Certificate, Identity};
4use std::{fs, io::Error, path::PathBuf, process::Command};
5use tokio::{
6 io::{AsyncReadExt, AsyncWrite, AsyncWriteExt},
7 net::{TcpListener, TcpStream},
8};
9use tokio_native_tls::{TlsAcceptor, TlsConnector};
10
11lazy_static! {
12 static ref CERT_DIR: PathBuf = {
13 if cfg!(unix) {
14 let dir = tempfile::TempDir::new().unwrap();
15 let path = dir.path().to_str().unwrap();
16
17 Command::new("sh")
18 .arg("-c")
19 .arg(format!("./scripts/generate-certificate.sh {}", path))
⋯8 lines
28}
29
30#[tokio::test]
31async fn client_to_server() {
32 let srv = TcpListener::bind("127.0.0.1:0").await.unwrap();
33 let addr = srv.local_addr().unwrap();
34
Rust reads from a named network stream lines 47–56
47:73… s_stream.get_ref();
48 let _tokio_tcp_stream: &tokio::net::TcpStream = allow_std_stream.get_ref();
49
50 let mut data = Vec::new();
51 socket.read_to_end(&mut data).await.unwrap();
52 data
53 };
54
55 // Create a future to connect to our server, connect the ssl stream, and
56 // then …
Rust TcpStream::connect call lines 56–71
56:29… data to it.
57 let client = async move {
58 let socket = TcpStream::connect(&addr).await.unwrap();
59 let socket = client_tls.connect("foobar.com", socket).await.unwrap();
60 copy_data(socket).await
61 };
62
63 // Finally, run everything!
64 let (data, _) = join!(server, client);
65 // assert_eq!(amt, AMT);
66 assert!(data == vec![9; AMT]);
67}
68
69#[tokio::test]
70async fn server_to_client() {
71 // Create a server l …
References a write-all buffer helper lines 107–118
107:53… wait.unwrap();
108 let mut amt = 0;
109 for b in std::iter::repeat(9).take(AMT) {
110 let data = [b as u8];
111 socket.write_all(&data).await.unwrap();
112 amt += 1;
113 }
⋯5 lines
Contains an unbounded block loop lines 119–124
119:54… om", socket).await.unwrap();
120 let mut data = Vec::new();
121 loop {
122 let mut buf = [0; 1];
123 match socket.read_exact(&mut buf).await {
124 Ok(_) => data.extend_fr …

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.