aboutsummaryrefslogtreecommitdiffstats
path: root/src/wireguard/handshake/device.rs
diff options
context:
space:
mode:
authorMathias Hall-Andersen <mathias@hall-andersen.dk>2019-10-23 10:32:18 +0200
committerMathias Hall-Andersen <mathias@hall-andersen.dk>2019-10-23 10:32:18 +0200
commit3fa928b3158ce33a57e9ba2c1913485eb409ff4b (patch)
tree87562a6c84bf421a19d01ef153927f3f8315cf98 /src/wireguard/handshake/device.rs
parentWork on porting timer semantics and linux platform (diff)
downloadwireguard-rs-3fa928b3158ce33a57e9ba2c1913485eb409ff4b.tar.xz
wireguard-rs-3fa928b3158ce33a57e9ba2c1913485eb409ff4b.zip
Work on platform specific code (Linux)
Diffstat (limited to 'src/wireguard/handshake/device.rs')
-rw-r--r--src/wireguard/handshake/device.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wireguard/handshake/device.rs b/src/wireguard/handshake/device.rs
index 6a55f6e..c2e3a6e 100644
--- a/src/wireguard/handshake/device.rs
+++ b/src/wireguard/handshake/device.rs
@@ -77,9 +77,9 @@ impl Device {
}
/// Return the secret key of the device
- ///
+ ///
/// # Returns
- ///
+ ///
/// A secret key (x25519 scalar)
pub fn get_sk(&self) -> StaticSecret {
StaticSecret::from(self.sk.to_bytes())
@@ -95,7 +95,7 @@ impl Device {
pub fn add(&mut self, pk: PublicKey) -> Result<(), ConfigError> {
// check that the pk is not added twice
if let Some(_) = self.pk_map.get(pk.as_bytes()) {
- return Err(ConfigError::new("Duplicate public key"));
+ return Ok(());
};
// check that the pk is not that of the device