diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-08-08 18:22:41 +0200 |
---|---|---|
committer | Samuel Holland <samuel@sholland.org> | 2017-08-08 18:22:41 +0200 |
commit | f6b864d4e70192ce780c3487b200506dec64f275 (patch) | |
tree | 2dd246d8891ce38393a6d16bcae3d1dbccf2b901 /app/src/main/java/com/wireguard/config | |
parent | f8d8e5e23e7e0dbbe4628803c2e99f9e2ece1bb3 (diff) |
Constant time base64
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'app/src/main/java/com/wireguard/config')
-rw-r--r-- | app/src/main/java/com/wireguard/config/Interface.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/src/main/java/com/wireguard/config/Interface.java b/app/src/main/java/com/wireguard/config/Interface.java index 35185cf9..9f74bab0 100644 --- a/app/src/main/java/com/wireguard/config/Interface.java +++ b/app/src/main/java/com/wireguard/config/Interface.java @@ -6,6 +6,7 @@ import android.databinding.Observable; import com.wireguard.android.BR; import com.wireguard.crypto.Keypair; +import com.wireguard.crypto.KeyEncoding; /** * Represents the configuration for a WireGuard interface (an [Interface] block). @@ -90,7 +91,7 @@ public class Interface extends BaseObservable implements Observable { public void setPrivateKey(String privateKey) { // Avoid exceptions from Keypair while the user is typing. - if (privateKey.length() != Keypair.KEY_STRING_LENGTH) + if (privateKey.length() != KeyEncoding.WG_KEY_LEN_BASE64) return; keypair = new Keypair(privateKey); notifyPropertyChanged(BR.privateKey); |