diff --git a/NearbyShare/Connection/InboundNearbyConnection.swift b/NearbyShare/Connection/InboundNearbyConnection.swift index 9008348..12417fa 100644 --- a/NearbyShare/Connection/InboundNearbyConnection.swift +++ b/NearbyShare/Connection/InboundNearbyConnection.swift @@ -27,8 +27,8 @@ class InboundNearbyConnection: NearbyConnection { private var textPayloadID: Int64 = 0 private var isPlainTextTransfer = false - public var wasRejected = false - public var delegate: InboundNearbyConnectionDelegate? + var wasRejected = false + var delegate: InboundNearbyConnectionDelegate? enum State { case initial, receivedConnectionRequest, sentUkeyServerInit, receivedUkeyClientFinish, sentConnectionResponse, sentPairedKeyResult, receivedPairedKeyResult, waitingForUserConsent, receivingFiles, disconnected @@ -300,7 +300,6 @@ class InboundNearbyConnection: NearbyConnection { let domain = Domain.instance(curve: .EC256r1) let (pubKey, privKey) = domain.makeKeyPair() - publicKey = pubKey privateKey = privKey var serverInit = Securegcm_Ukey2ServerInit() diff --git a/NearbyShare/Connection/NearbyConnection.swift b/NearbyShare/Connection/NearbyConnection.swift index e75f1df..e31567f 100644 --- a/NearbyShare/Connection/NearbyConnection.swift +++ b/NearbyShare/Connection/NearbyConnection.swift @@ -40,7 +40,6 @@ class NearbyConnection { private let timeoutInterval: TimeInterval = 30 // UKEY2-related state - var publicKey: ECPublicKey? var privateKey: ECPrivateKey? var ukeyClientInitMsgData: Data? var ukeyServerInitMsgData: Data? diff --git a/NearbyShare/Connection/NearbyConnectionManager.swift b/NearbyShare/Connection/NearbyConnectionManager.swift index 0016ca0..a7be723 100644 --- a/NearbyShare/Connection/NearbyConnectionManager.swift +++ b/NearbyShare/Connection/NearbyConnectionManager.swift @@ -27,11 +27,9 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb private var startedDeviceDiscovery = false private var browsers: [NWBrowser] = [] private let serviceTypes = ["_FC9F5ED42C8A._tcp."] - private var qrCodePublicKey: ECPublicKey? private var qrCodePrivateKey: ECPrivateKey? private var qrCodeAdvertisingToken: Data? private var qrCodeNameEncryptionKey: SymmetricKey? - private var qrCodeData: Data? public let endpointID: [UInt8] = generateEndpointID() public var mainAppDelegate: (any MainAppDelegate)? @@ -302,7 +300,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb public func generateQrCodeKey() -> String{ let domain = Domain.instance(curve: .EC256r1) let (pubKey, privKey) = domain.makeKeyPair() - qrCodePublicKey = pubKey qrCodePrivateKey = privKey var keyData = Data() keyData.append(contentsOf: [0, 0, 2]) @@ -313,7 +310,6 @@ public class NearbyConnectionManager: NSObject, NetServiceDelegate, InboundNearb let ikm = SymmetricKey(data: keyData) qrCodeAdvertisingToken = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "advertisingContext".data(using: .utf8)!, outputLength: 16).data() qrCodeNameEncryptionKey = HKDF.deriveKey(ikm: ikm, salt: Data(), info: "encryptionKey".data(using: .utf8)!, outputLength: 16) - qrCodeData = keyData return keyData.urlSafeBase64EncodedString() } diff --git a/NearbyShare/Connection/OutboundNearbyConnection.swift b/NearbyShare/Connection/OutboundNearbyConnection.swift index 6511b36..6ac0fbf 100644 --- a/NearbyShare/Connection/OutboundNearbyConnection.swift +++ b/NearbyShare/Connection/OutboundNearbyConnection.swift @@ -185,7 +185,6 @@ class OutboundNearbyConnection: NearbyConnection { private func sendUkey2ClientInit() throws { let domain = Domain.instance(curve: .EC256r1) let (pubKey, privKey) = domain.makeKeyPair() - publicKey = pubKey privateKey = privKey var finishFrame = Securegcm_Ukey2Message() diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index 78afd6b..09ed309 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -810,6 +810,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = "${SHARED_VERSION}"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -842,6 +843,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = "${SHARED_VERSION}"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop.ShareExtension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1012,6 +1014,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = "${SHARED_VERSION}"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1052,6 +1055,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = "${SHARED_VERSION}"; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -1086,6 +1090,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; @@ -1123,6 +1128,7 @@ ); MACOSX_DEPLOYMENT_TARGET = 11.0; MARKETING_VERSION = 1.0; + OTHER_SWIFT_FLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = com.leonboettger.neardrop; PRODUCT_NAME = "$(TARGET_NAME)"; SDKROOT = iphoneos; diff --git a/QuickDrop/AppDelegate.swift b/QuickDrop/AppDelegate.swift index 3746c76..b1987a2 100644 --- a/QuickDrop/AppDelegate.swift +++ b/QuickDrop/AppDelegate.swift @@ -121,7 +121,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCenterDele welcomeWindow = nil NSApp.setActivationPolicy(.accessory) } - } + } func applicationShouldHandleReopen(_: NSApplication, hasVisibleWindows _: Bool) -> Bool {