aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2019-02-08 14:39:59 +0100
committerJason A. Donenfeld <Jason@zx2c4.com>2019-02-08 14:39:59 +0100
commit407b367c8de6569f8a8ab17dc0f3765936d9c864 (patch)
tree6fc1fcca85de4642a06b0edbd64856685f8ae613
parentInfo.plist: Add missing key types (diff)
downloadwireguard-apple-407b367c8de6569f8a8ab17dc0f3765936d9c864.tar.xz
wireguard-apple-407b367c8de6569f8a8ab17dc0f3765936d9c864.zip
Key: we already do len checking in C
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/Shared/Model/Key.swift6
1 files changed, 0 insertions, 6 deletions
diff --git a/WireGuard/Shared/Model/Key.swift b/WireGuard/Shared/Model/Key.swift
index 3f11452..a1abdd7 100644
--- a/WireGuard/Shared/Model/Key.swift
+++ b/WireGuard/Shared/Model/Key.swift
@@ -23,9 +23,6 @@ extension Data {
}
init?(hexKey hexString: String) {
- if hexString.utf8.count != WG_KEY_LEN_HEX - 1 {
- return nil
- }
self.init(repeating: 0, count: Int(WG_KEY_LEN))
if !self.withUnsafeMutableBytes { key_from_hex($0, hexString) } {
@@ -48,9 +45,6 @@ extension Data {
}
init?(base64Key base64String: String) {
- if base64String.utf8.count != WG_KEY_LEN_BASE64 - 1 {
- return nil
- }
self.init(repeating: 0, count: Int(WG_KEY_LEN))
if !self.withUnsafeMutableBytes { key_from_base64($0, base64String) } {