Closed Ange-Cesari closed 9 months ago
Right now we do not support pre-shared key, but we will put this on the roadmap.
Hi @teon
Would it be possible to have a link to that roadmap ? I couldn't find it on github. Is it public ?
Best, Ange
fwiw i'm using this as a workaround at the moment:
let mut file = NamedTempFile::new()?;
writeln!(file, "{}", preshared_key.to_string());
let path = file.into_temp_path();
println!("wrote psk to file {:#?}", path);
let output = std::process::Command::new("wg")
.args(["set", interface_name, "peer", &peer_public_key.to_string(), "preshared-key", path.to_str().unwrap()])
.output()?;
path.close()?;
Hey @master-hax ,
Thank you for the work around. Unfortunately I can't write on the disk and I can't process command from the binary due to security reasons, so I guess I'll have to wait for @wojcik91 to implement it.
Best, Ange
Hi @Ange-Cesari & @master-hax!
I did not have time to look into this yet, but from what I know the Peer
struct already includes an optional preshared_key
field.
Did you try it out?
Hi @Ange-Cesari & @master-hax! I did not have time to look into this yet, but from what I know the
Peer
struct already includes an optionalpreshared_key
field.Did you try it out?
Yes I've tried it out.
The key passed to the struct is persisted and looks like it gets applied when the interface configuration is read back.
However, if we double-check the peer with wg show
we can see that the preshared key is not set.
Hey, @wojcik91
I tried too,
It seems it's not a structure issue, it's an interface configuration issue and more like how are applied the different fields
Hi. There was indeed a bug in Linux implementation. Should be resolved now by https://github.com/DefGuard/wireguard-rs/pull/21. I'll make a new patch release shortly.
Hi,
I couldn't see any code related to the presharedkey for the server (nor the client)
Is it supported ?
If so, would it be possible to provide a example with presharedkey support ?
If it's supported by the library but not implemented yet (macros, public function...), do you think it's possible to provide an example of how to create the presharedkey with dalek and write to the api ?
Thanks, Ange