Constant time base64
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
committed by
Samuel Holland
parent
f8d8e5e23e
commit
f6b864d4e7
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user