Skip to content

Commit bca3500

Browse files
committed
remvoe flipper RNG + guard test module to dist-{client,server}
1 parent 2294f1b commit bca3500

File tree

2 files changed

+1
-47
lines changed

2 files changed

+1
-47
lines changed

src/dist/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ mod cache;
3434
pub mod client_auth;
3535
#[cfg(any(feature = "dist-client", feature = "dist-server"))]
3636
pub mod http;
37+
3738
#[cfg(test)]
3839
mod test;
3940

src/dist/test.rs

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -98,53 +98,6 @@ fn create_https_cert_and_privkey_legacy_openssl(
9898
Ok((cert_digest, cert_pem, privkey_pem))
9999
}
100100

101-
#[allow(dead_code)]
102-
#[derive(Default, Debug, Clone, Copy)]
103-
struct FlipperRng(u8);
104-
105-
use rand::CryptoRng;
106-
107-
impl FlipperRng {
108-
fn next_byte(&mut self) -> u8 {
109-
let v = self.0;
110-
self.0 = self.0.wrapping_add(17);
111-
v
112-
}
113-
114-
fn fill_array<const N: usize>(&mut self, dest: &mut [u8; N]) {
115-
#[allow(clippy::needless_range_loop)]
116-
for i in 0..N {
117-
dest[i] = self.next_byte();
118-
}
119-
}
120-
}
121-
impl CryptoRng for FlipperRng {}
122-
123-
impl RngCore for FlipperRng {
124-
fn next_u32(&mut self) -> u32 {
125-
let mut v = [0u8; 4];
126-
self.fill_array(&mut v);
127-
u32::from_le_bytes(v)
128-
}
129-
130-
fn next_u64(&mut self) -> u64 {
131-
let mut v = [0u8; 8];
132-
self.fill_array(&mut v);
133-
u64::from_le_bytes(v)
134-
}
135-
136-
fn fill_bytes(&mut self, dest: &mut [u8]) {
137-
for byte in dest {
138-
*byte = self.next_byte();
139-
}
140-
}
141-
142-
fn try_fill_bytes(&mut self, dest: &mut [u8]) -> std::result::Result<(), rand::Error> {
143-
self.fill_bytes(dest);
144-
Ok(())
145-
}
146-
}
147-
148101
#[test]
149102
fn certificate_compatibility_assurance() {
150103
let now: NaiveDateTime = Utc::now().naive_utc();

0 commit comments

Comments
 (0)