Skip to content

Commit 3bdd14e

Browse files
committed
Fix building public key from private key
1 parent 59ea9bd commit 3bdd14e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/key.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ impl Key {
9898
/// Make WireGuard public key from a private key.
9999
#[must_use]
100100
pub fn public_key(&self) -> Self {
101-
Self(PublicKey::from(self.0).to_bytes())
101+
let secret = StaticSecret::from(self.0);
102+
Self(PublicKey::from(&secret).to_bytes())
102103
}
103104
}
104105

0 commit comments

Comments
 (0)