Skip to content

Commit d2ae1b5

Browse files
Fix FFI
1 parent f8aa2e3 commit d2ae1b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

boringtun/src/ffi/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use hex::encode as encode_hex;
1313
use libc::{raise, SIGSEGV};
1414
use parking_lot::Mutex;
1515
use rand::rngs::OsRng;
16+
use rand::TryRngCore;
1617
use tracing;
1718
use tracing_subscriber::fmt;
1819

@@ -100,7 +101,7 @@ pub struct x25519_key {
100101
#[no_mangle]
101102
pub extern "C" fn x25519_secret_key() -> x25519_key {
102103
x25519_key {
103-
key: StaticSecret::random_from_rng(OsRng).to_bytes(),
104+
key: StaticSecret::random_from_rng(&mut OsRng.unwrap_mut()).to_bytes(),
104105
}
105106
}
106107

0 commit comments

Comments
 (0)