From 58488523d1cece965eeea36680372dea15978b27 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 19 Jun 2024 15:14:35 -0400 Subject: [PATCH 1/1] Initial Commit --- .gitignore | 3 + Daemon/Daemon.swift | 102 ++ Daemon/main.swift | 26 + Daemon/org.bluestatic.InterAuth.plist | 17 + InterAuth.xcodeproj/project.pbxproj | 959 ++++++++++++++++++ .../contents.xcworkspacedata | 7 + .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/xcschemes/InterAuth.xcscheme | 66 ++ PAM/pam_interauth.c | 114 +++ Tool/main.swift | 62 ++ 10 files changed, 1364 insertions(+) create mode 100644 .gitignore create mode 100644 Daemon/Daemon.swift create mode 100644 Daemon/main.swift create mode 100644 Daemon/org.bluestatic.InterAuth.plist create mode 100644 InterAuth.xcodeproj/project.pbxproj create mode 100644 InterAuth.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 InterAuth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 InterAuth.xcodeproj/xcshareddata/xcschemes/InterAuth.xcscheme create mode 100644 PAM/pam_interauth.c create mode 100644 Tool/main.swift diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b3d61b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +DerivedData/ +InterAuth.xcodeproj/xcuserdata/ +InterAuth.xcodeproj/project.xcworkspace/xcuserdata/ diff --git a/Daemon/Daemon.swift b/Daemon/Daemon.swift new file mode 100644 index 0000000..2baa813 --- /dev/null +++ b/Daemon/Daemon.swift @@ -0,0 +1,102 @@ +// +// Daemon.swift +// InterAuth +// +// Created by Robert Sesek on 6/19/24. +// + +import Foundation +import OSLog + +extension OS_xpc_object { + func description() -> String { + let d = xpc_copy_description(self) + let r = String(cString: d) + free(d) + return r + } +} + +class Daemon { + private var connection: xpc_connection_t? + private var log = Logger(subsystem: "org.bluestatic.InterAuth", category: "Daemon") + + func onControlConnection(_ obj: xpc_object_t) { + guard xpc_get_type(obj) == XPC_TYPE_CONNECTION else { + log.error("Control connection failure: \(obj.description, privacy: .public)") + return + } + + guard xpc_connection_get_euid(obj) == 0 else { + log.error("Rejecting control connection from non-root user") + return + } + + guard connection == nil else { + log.warning("Rejecting control connection, existing connection established") + return + } + + log.log("Establishing new control connection") + connection = obj as xpc_connection_t + xpc_connection_set_event_handler(connection!) { + self.onControlMessage($0) + } + xpc_connection_resume(connection!) + } + + private func onControlMessage(_ obj: xpc_object_t) { + if xpc_equal(obj, XPC_ERROR_CONNECTION_INVALID) || xpc_equal(obj, XPC_ERROR_CONNECTION_INTERRUPTED) { + log.log("Control connection disconnected") + connection = nil + return + } + } + + func onAuthConnection(_ obj: xpc_object_t) { + guard xpc_get_type(obj) == XPC_TYPE_CONNECTION else { + log.error("Auth connection failure: \(obj.description, privacy: .public)") + return + } + guard connection != nil else { + log.log("Received authentication connection, but there is no active control connection") + return + } + + xpc_connection_set_event_handler(obj) { + self.onAuthMessage(connection: obj, $0) + } + xpc_connection_resume(obj) + } + + private func onAuthMessage(connection authConn: xpc_object_t, _ obj: xpc_object_t) { + guard connection != nil, + xpc_get_type(obj) == XPC_TYPE_DICTIONARY else { + log.log("Authentication connection disconnected") + xpc_connection_set_event_handler(authConn) { _ in } + xpc_release(authConn) + return + } + + guard let action = xpc_dictionary_get_string(obj, "action"), + String(cString: action) == "authenticate" else { + log.error("Unexpected authentication connection message: \(obj.description, privacy: .public)") + return + } + + guard let reply = xpc_dictionary_create_reply(obj) else { + return + } + + log.log("Received authentication request, forwarding to control: \(obj.description, privacy: .public)") + + let req = xpc_dictionary_create_empty() + xpc_dictionary_set_value(req, "request", obj) + xpc_connection_send_message_with_reply(connection!, req, nil) { response in + self.log.log("Received control channel response: \(response.description, privacy: .public)") + xpc_dictionary_set_string(reply, "reply", "authenticate") + xpc_dictionary_set_bool(reply, "result", xpc_dictionary_get_bool(response, "result")) + xpc_connection_send_message(authConn, reply) + } + } +} diff --git a/Daemon/main.swift b/Daemon/main.swift new file mode 100644 index 0000000..bb38d76 --- /dev/null +++ b/Daemon/main.swift @@ -0,0 +1,26 @@ +// +// main.swift +// InterAuth +// +// Created by Robert Sesek on 6/19/24. +// + +import Foundation +import XPC + +let daemon = Daemon() +let q = DispatchQueue(label: "org.bluestatic.InterAuth", qos: .userInteractive) + +let ctrlConn = xpc_connection_create_mach_service("org.bluestatic.InterAuth.Control", q, UInt64(XPC_CONNECTION_MACH_SERVICE_LISTENER)) +xpc_connection_set_event_handler(ctrlConn) { + daemon.onControlConnection($0) +} +xpc_connection_resume(ctrlConn) + +let authConn = xpc_connection_create_mach_service("org.bluestatic.InterAuth.Auth", q, UInt64(XPC_CONNECTION_MACH_SERVICE_LISTENER)) +xpc_connection_set_event_handler(authConn) { + daemon.onAuthConnection($0) +} +xpc_connection_resume(authConn) + +dispatchMain() diff --git a/Daemon/org.bluestatic.InterAuth.plist b/Daemon/org.bluestatic.InterAuth.plist new file mode 100644 index 0000000..ead533f --- /dev/null +++ b/Daemon/org.bluestatic.InterAuth.plist @@ -0,0 +1,17 @@ + + + + + Label + org.bluestatic.InterAuth + ProgramArguments + + /Library/InterAuth.bundle/Contents/MacOS/InterAuth + + MachServices + + org.bluestatic.InterAuth.Auth + org.bluestatic.InterAuth.Control + + + diff --git a/InterAuth.xcodeproj/project.pbxproj b/InterAuth.xcodeproj/project.pbxproj new file mode 100644 index 0000000..ae6633b --- /dev/null +++ b/InterAuth.xcodeproj/project.pbxproj @@ -0,0 +1,959 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 56; + objects = { + +/* Begin PBXBuildFile section */ + 1EC7F7872C231A9B001CCD94 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7F7862C231A9B001CCD94 /* main.swift */; }; + 1EC7F7922C231AB2001CCD94 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7F7912C231AB2001CCD94 /* main.swift */; }; + 1EC7F7A62C231B15001CCD94 /* InterAuth in Copy Files */ = {isa = PBXBuildFile; fileRef = 1EC7F7842C231A9B001CCD94 /* InterAuth */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 1EC7F7A72C231B15001CCD94 /* interauthctl in Copy Files */ = {isa = PBXBuildFile; fileRef = 1EC7F78F2C231AB2001CCD94 /* interauthctl */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 1EC7F7AA2C231C72001CCD94 /* Daemon.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7F7A92C231C72001CCD94 /* Daemon.swift */; }; + 1EC7F7AF2C232085001CCD94 /* pam_interauth.c in Sources */ = {isa = PBXBuildFile; fileRef = 1EC7F7AE2C232085001CCD94 /* pam_interauth.c */; }; + 1EC7F7B12C232302001CCD94 /* pam_interauth.so.2 in CopyFiles */ = {isa = PBXBuildFile; fileRef = 1EC7F79A2C231AD7001CCD94 /* pam_interauth.so.2 */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; + 1EC7F7B62C2323C3001CCD94 /* libpam.2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC7F7B52C2323C0001CCD94 /* libpam.2.tbd */; }; + 1EC7F7B82C232939001CCD94 /* libSystem.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 1EC7F7B72C232932001CCD94 /* libSystem.tbd */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 1EC7F79E2C231AF3001CCD94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1EC7F7712C231A3E001CCD94 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1EC7F7832C231A9B001CCD94; + remoteInfo = Daemon; + }; + 1EC7F7A02C231AF5001CCD94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1EC7F7712C231A3E001CCD94 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1EC7F78E2C231AB2001CCD94; + remoteInfo = interauthctl; + }; + 1EC7F7A22C231AF6001CCD94 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 1EC7F7712C231A3E001CCD94 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 1EC7F7992C231AD7001CCD94; + remoteInfo = pam_interauth; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXCopyFilesBuildPhase section */ + 1EC7F7822C231A9B001CCD94 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 1EC7F78D2C231AB2001CCD94 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; + 1EC7F7A52C231B08001CCD94 /* Copy Files */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 6; + files = ( + 1EC7F7A62C231B15001CCD94 /* InterAuth in Copy Files */, + 1EC7F7A72C231B15001CCD94 /* interauthctl in Copy Files */, + ); + name = "Copy Files"; + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F7B02C2322E6001CCD94 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = Contents/Libraries; + dstSubfolderSpec = 1; + files = ( + 1EC7F7B12C232302001CCD94 /* pam_interauth.so.2 in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + 1EC7F77B2C231A7B001CCD94 /* InterAuth.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = InterAuth.bundle; sourceTree = BUILT_PRODUCTS_DIR; }; + 1EC7F7842C231A9B001CCD94 /* InterAuth */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = InterAuth; sourceTree = BUILT_PRODUCTS_DIR; }; + 1EC7F7862C231A9B001CCD94 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 1EC7F78F2C231AB2001CCD94 /* interauthctl */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = interauthctl; sourceTree = BUILT_PRODUCTS_DIR; }; + 1EC7F7912C231AB2001CCD94 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = ""; }; + 1EC7F79A2C231AD7001CCD94 /* pam_interauth.so.2 */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = pam_interauth.so.2; sourceTree = BUILT_PRODUCTS_DIR; }; + 1EC7F7A92C231C72001CCD94 /* Daemon.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Daemon.swift; sourceTree = ""; }; + 1EC7F7AE2C232085001CCD94 /* pam_interauth.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = pam_interauth.c; sourceTree = ""; }; + 1EC7F7B52C2323C0001CCD94 /* libpam.2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libpam.2.tbd; path = usr/lib/libpam.2.tbd; sourceTree = SDKROOT; }; + 1EC7F7B72C232932001CCD94 /* libSystem.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libSystem.tbd; path = usr/lib/libSystem.tbd; sourceTree = SDKROOT; }; + 1EC7F7B92C233006001CCD94 /* org.bluestatic.InterAuth.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = org.bluestatic.InterAuth.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1EC7F7782C231A7B001CCD94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F7812C231A9B001CCD94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F78C2C231AB2001CCD94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F7982C231AD7001CCD94 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1EC7F7B62C2323C3001CCD94 /* libpam.2.tbd in Frameworks */, + 1EC7F7B82C232939001CCD94 /* libSystem.tbd in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 1EC7F7702C231A3E001CCD94 = { + isa = PBXGroup; + children = ( + 1EC7F7852C231A9B001CCD94 /* Daemon */, + 1EC7F7AD2C232085001CCD94 /* PAM */, + 1EC7F7902C231AB2001CCD94 /* Tool */, + 1EC7F77C2C231A7B001CCD94 /* Products */, + 1EC7F7B22C2323AF001CCD94 /* Frameworks */, + ); + sourceTree = ""; + }; + 1EC7F77C2C231A7B001CCD94 /* Products */ = { + isa = PBXGroup; + children = ( + 1EC7F77B2C231A7B001CCD94 /* InterAuth.bundle */, + 1EC7F7842C231A9B001CCD94 /* InterAuth */, + 1EC7F78F2C231AB2001CCD94 /* interauthctl */, + 1EC7F79A2C231AD7001CCD94 /* pam_interauth.so.2 */, + ); + name = Products; + sourceTree = ""; + }; + 1EC7F7852C231A9B001CCD94 /* Daemon */ = { + isa = PBXGroup; + children = ( + 1EC7F7862C231A9B001CCD94 /* main.swift */, + 1EC7F7A92C231C72001CCD94 /* Daemon.swift */, + 1EC7F7B92C233006001CCD94 /* org.bluestatic.InterAuth.plist */, + ); + path = Daemon; + sourceTree = ""; + }; + 1EC7F7902C231AB2001CCD94 /* Tool */ = { + isa = PBXGroup; + children = ( + 1EC7F7912C231AB2001CCD94 /* main.swift */, + ); + path = Tool; + sourceTree = ""; + }; + 1EC7F7AD2C232085001CCD94 /* PAM */ = { + isa = PBXGroup; + children = ( + 1EC7F7AE2C232085001CCD94 /* pam_interauth.c */, + ); + path = PAM; + sourceTree = ""; + }; + 1EC7F7B22C2323AF001CCD94 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1EC7F7B72C232932001CCD94 /* libSystem.tbd */, + 1EC7F7B52C2323C0001CCD94 /* libpam.2.tbd */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 1EC7F7962C231AD7001CCD94 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 1EC7F77A2C231A7B001CCD94 /* InterAuth */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1EC7F77D2C231A7B001CCD94 /* Build configuration list for PBXNativeTarget "InterAuth" */; + buildPhases = ( + 1EC7F7772C231A7B001CCD94 /* Sources */, + 1EC7F7782C231A7B001CCD94 /* Frameworks */, + 1EC7F7792C231A7B001CCD94 /* Resources */, + 1EC7F7A52C231B08001CCD94 /* Copy Files */, + 1EC7F7B02C2322E6001CCD94 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + 1EC7F79F2C231AF3001CCD94 /* PBXTargetDependency */, + 1EC7F7A12C231AF5001CCD94 /* PBXTargetDependency */, + 1EC7F7A32C231AF6001CCD94 /* PBXTargetDependency */, + ); + name = InterAuth; + productName = InterAuth; + productReference = 1EC7F77B2C231A7B001CCD94 /* InterAuth.bundle */; + productType = "com.apple.product-type.bundle"; + }; + 1EC7F7832C231A9B001CCD94 /* Daemon */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1EC7F7882C231A9B001CCD94 /* Build configuration list for PBXNativeTarget "Daemon" */; + buildPhases = ( + 1EC7F7802C231A9B001CCD94 /* Sources */, + 1EC7F7812C231A9B001CCD94 /* Frameworks */, + 1EC7F7822C231A9B001CCD94 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Daemon; + productName = Daemon; + productReference = 1EC7F7842C231A9B001CCD94 /* InterAuth */; + productType = "com.apple.product-type.tool"; + }; + 1EC7F78E2C231AB2001CCD94 /* interauthctl */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1EC7F7932C231AB2001CCD94 /* Build configuration list for PBXNativeTarget "interauthctl" */; + buildPhases = ( + 1EC7F78B2C231AB2001CCD94 /* Sources */, + 1EC7F78C2C231AB2001CCD94 /* Frameworks */, + 1EC7F78D2C231AB2001CCD94 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = interauthctl; + productName = interauthctl; + productReference = 1EC7F78F2C231AB2001CCD94 /* interauthctl */; + productType = "com.apple.product-type.tool"; + }; + 1EC7F7992C231AD7001CCD94 /* pam_interauth */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1EC7F79B2C231AD7001CCD94 /* Build configuration list for PBXNativeTarget "pam_interauth" */; + buildPhases = ( + 1EC7F7962C231AD7001CCD94 /* Headers */, + 1EC7F7972C231AD7001CCD94 /* Sources */, + 1EC7F7982C231AD7001CCD94 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = pam_interauth; + productName = pam_interauth; + productReference = 1EC7F79A2C231AD7001CCD94 /* pam_interauth.so.2 */; + productType = "com.apple.product-type.library.dynamic"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 1EC7F7712C231A3E001CCD94 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1430; + LastUpgradeCheck = 1430; + TargetAttributes = { + 1EC7F77A2C231A7B001CCD94 = { + CreatedOnToolsVersion = 14.3.1; + }; + 1EC7F7832C231A9B001CCD94 = { + CreatedOnToolsVersion = 14.3.1; + }; + 1EC7F78E2C231AB2001CCD94 = { + CreatedOnToolsVersion = 14.3.1; + }; + 1EC7F7992C231AD7001CCD94 = { + CreatedOnToolsVersion = 14.3.1; + }; + }; + }; + buildConfigurationList = 1EC7F7742C231A3E001CCD94 /* Build configuration list for PBXProject "InterAuth" */; + compatibilityVersion = "Xcode 14.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 1EC7F7702C231A3E001CCD94; + productRefGroup = 1EC7F77C2C231A7B001CCD94 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1EC7F77A2C231A7B001CCD94 /* InterAuth */, + 1EC7F7832C231A9B001CCD94 /* Daemon */, + 1EC7F78E2C231AB2001CCD94 /* interauthctl */, + 1EC7F7992C231AD7001CCD94 /* pam_interauth */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1EC7F7792C231A7B001CCD94 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1EC7F7772C231A7B001CCD94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F7802C231A9B001CCD94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1EC7F7872C231A9B001CCD94 /* main.swift in Sources */, + 1EC7F7AA2C231C72001CCD94 /* Daemon.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F78B2C231AB2001CCD94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1EC7F7922C231AB2001CCD94 /* main.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 1EC7F7972C231AD7001CCD94 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1EC7F7AF2C232085001CCD94 /* pam_interauth.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 1EC7F79F2C231AF3001CCD94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1EC7F7832C231A9B001CCD94 /* Daemon */; + targetProxy = 1EC7F79E2C231AF3001CCD94 /* PBXContainerItemProxy */; + }; + 1EC7F7A12C231AF5001CCD94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1EC7F78E2C231AB2001CCD94 /* interauthctl */; + targetProxy = 1EC7F7A02C231AF5001CCD94 /* PBXContainerItemProxy */; + }; + 1EC7F7A32C231AF6001CCD94 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 1EC7F7992C231AD7001CCD94 /* pam_interauth */; + targetProxy = 1EC7F7A22C231AF6001CCD94 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 1EC7F7752C231A3E001CCD94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Debug; + }; + 1EC7F7762C231A3E001CCD94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + }; + name = Release; + }; + 1EC7F77E2C231A7B001CCD94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = W5LGKPS77P; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSPrincipalClass = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.bluestatic.InterAuth; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + }; + name = Debug; + }; + 1EC7F77F2C231A7B001CCD94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Developer ID Application"; + CODE_SIGN_STYLE = Manual; + COMBINE_HIDPI_IMAGES = YES; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = ""; + "DEVELOPMENT_TEAM[sdk=macosx*]" = W5LGKPS77P; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + INFOPLIST_KEY_NSPrincipalClass = ""; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles"; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = org.bluestatic.InterAuth; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SDKROOT = macosx; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + }; + name = Release; + }; + 1EC7F7892C231A9B001CCD94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = InterAuth; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 1EC7F78A2C231A9B001CCD94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = InterAuth; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 1EC7F7942C231AB2001CCD94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + }; + name = Debug; + }; + 1EC7F7952C231AB2001CCD94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; + SWIFT_VERSION = 5.0; + }; + name = Release; + }; + 1EC7F79C2C231AD7001CCD94 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + EXECUTABLE_EXTENSION = so.2; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SDKROOT)/usr/lib/system", + ); + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Debug; + }; + 1EC7F79D2C231AD7001CCD94 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_STYLE = Automatic; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + EXECUTABLE_EXTENSION = so.2; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LIBRARY_SEARCH_PATHS = ( + "$(inherited)", + "$(SDKROOT)/usr/lib/system", + ); + MACOSX_DEPLOYMENT_TARGET = 13.3; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = macosx; + SKIP_INSTALL = YES; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1EC7F7742C231A3E001CCD94 /* Build configuration list for PBXProject "InterAuth" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC7F7752C231A3E001CCD94 /* Debug */, + 1EC7F7762C231A3E001CCD94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1EC7F77D2C231A7B001CCD94 /* Build configuration list for PBXNativeTarget "InterAuth" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC7F77E2C231A7B001CCD94 /* Debug */, + 1EC7F77F2C231A7B001CCD94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1EC7F7882C231A9B001CCD94 /* Build configuration list for PBXNativeTarget "Daemon" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC7F7892C231A9B001CCD94 /* Debug */, + 1EC7F78A2C231A9B001CCD94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1EC7F7932C231AB2001CCD94 /* Build configuration list for PBXNativeTarget "interauthctl" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC7F7942C231AB2001CCD94 /* Debug */, + 1EC7F7952C231AB2001CCD94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 1EC7F79B2C231AD7001CCD94 /* Build configuration list for PBXNativeTarget "pam_interauth" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1EC7F79C2C231AD7001CCD94 /* Debug */, + 1EC7F79D2C231AD7001CCD94 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 1EC7F7712C231A3E001CCD94 /* Project object */; +} diff --git a/InterAuth.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/InterAuth.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/InterAuth.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/InterAuth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/InterAuth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/InterAuth.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/InterAuth.xcodeproj/xcshareddata/xcschemes/InterAuth.xcscheme b/InterAuth.xcodeproj/xcshareddata/xcschemes/InterAuth.xcscheme new file mode 100644 index 0000000..e99c8ef --- /dev/null +++ b/InterAuth.xcodeproj/xcshareddata/xcschemes/InterAuth.xcscheme @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/PAM/pam_interauth.c b/PAM/pam_interauth.c new file mode 100644 index 0000000..8ea1b9d --- /dev/null +++ b/PAM/pam_interauth.c @@ -0,0 +1,114 @@ +// +// pam_interauth.c +// pam_interauth +// +// Created by Robert Sesek on 6/19/24. +// + +#include +#include +#include + +#define PAM_SM_AUTH +#include +#include +#include + +static os_log_t get_log(void) { + static dispatch_once_t token; + static os_log_t log; + dispatch_once(&token, ^{ + log = os_log_create("org.bluestatic.InterAuth", "PAM"); + }); + return log; +} + +static void message_handler(xpc_object_t obj, dispatch_semaphore_t sema, int* pam_return) { + dispatch_semaphore_signal(sema); + + if (obj == XPC_ERROR_CONNECTION_INVALID) { + os_log(get_log(), "Connection invalid"); + *pam_return = PAM_AUTHINFO_UNAVAIL; + return; + } + if (obj == XPC_ERROR_CONNECTION_INTERRUPTED) { + os_log(get_log(), "Connection interrupted"); + *pam_return = PAM_SYSTEM_ERR; + return; + } + + os_log(get_log(), "Received reply from daemon"); + + const char* reply = xpc_dictionary_get_string(obj, "reply"); + if (!reply || strcmp(reply, "authenticate") != 0) { + *pam_return = PAM_SERVICE_ERR; + return; + } + + if (xpc_dictionary_get_bool(obj, "result")) { + *pam_return = PAM_SUCCESS; + } else { + *pam_return = PAM_PERM_DENIED; + } +} + +int pam_sm_authenticate(pam_handle_t* pamh, int flags, int argc, const char** argv) { + __block int auth_result = PAM_SERVICE_ERR; + int status = PAM_SYSTEM_ERR; + + os_log(get_log(), "Starting pam_sm_authenticate"); + + char* user; + if ((status = pam_get_item(pamh, PAM_USER, (const void**) &user)) != PAM_SUCCESS) { + return status; + } + + char* service; + if ((status = pam_get_item(pamh, PAM_SERVICE, (const void**) &service)) != PAM_SUCCESS) { + return status; + } + + char* applicant; + if ((status = pam_get_item(pamh, PAM_RUSER, (const void**) &applicant)) != PAM_SUCCESS) { + return status; + } + + os_log(get_log(), "Sending request to daemon"); + + dispatch_semaphore_t sema = dispatch_semaphore_create(0); + + dispatch_queue_t q = dispatch_queue_create("org.bluestatic.InterAuth.PAM", DISPATCH_QUEUE_SERIAL); + xpc_connection_t conn = xpc_connection_create_mach_service("org.bluestatic.InterAuth.Auth", q, XPC_CONNECTION_MACH_SERVICE_PRIVILEGED); + xpc_connection_set_event_handler(conn, ^(xpc_object_t _Nonnull object) { + message_handler(object, sema, &auth_result); + }); + xpc_connection_resume(conn); + + xpc_object_t msg = xpc_dictionary_create_empty(); + xpc_dictionary_set_string(msg, "action", "authenticate"); + if (user) { + xpc_dictionary_set_string(msg, "user", user); + } + if (service) { + xpc_dictionary_set_string(msg, "service", service); + } + if (applicant) { + xpc_dictionary_set_string(msg, "applicant", applicant); + } + xpc_connection_send_message_with_reply(conn, msg, q, ^(xpc_object_t _Nonnull object) { + message_handler(object, sema, &auth_result); + }); + + if (dispatch_semaphore_wait(sema, dispatch_time(DISPATCH_WALLTIME_NOW, 30 * NSEC_PER_SEC))) { + os_log_error(get_log(), "Timed out waiting for reply from daemon"); + auth_result = PAM_AUTHINFO_UNAVAIL; + } + + xpc_release(conn); + dispatch_release(q); + dispatch_release(sema); + + os_log(get_log(), "Final auth disposition = %d", auth_result); + + return auth_result; +} diff --git a/Tool/main.swift b/Tool/main.swift new file mode 100644 index 0000000..415f915 --- /dev/null +++ b/Tool/main.swift @@ -0,0 +1,62 @@ +// +// main.swift +// interauthctl +// +// Created by Robert Sesek on 6/19/24. +// + +import Foundation +import XPC + +if getuid() != 0 { + print("This command can only be run by root.") + exit(-EPERM) +} + +print("Starting InterAuth control session.") + +let conn = xpc_connection_create_mach_service("org.bluestatic.InterAuth.Control", DispatchQueue.main, UInt64(XPC_CONNECTION_MACH_SERVICE_PRIVILEGED)) +xpc_connection_set_event_handler(conn) { (msg: xpc_object_t) in + if xpc_equal(msg, XPC_ERROR_CONNECTION_INVALID) { + print("Failed to connect to service.") + exit(EXIT_FAILURE) + } + if xpc_equal(msg, XPC_ERROR_CONNECTION_INTERRUPTED) { + print("Connection to service interrupted.") + exit(EXIT_FAILURE) + } + + guard let req = xpc_dictionary_get_dictionary(msg, "request") else { + print("Malformed XPC message: \(xpc_copy_description(msg))") + return + } + + print("\n*** Authentication Request ***") + print(" User = \(String(describing: xpc_dictionary_get_string(req, "user")))") + print(" Service = \(String(describing: xpc_dictionary_get_string(req, "service")))") + print(" Applicant = \(String(describing: xpc_dictionary_get_string(req, "applicant")))") + + var authorize = false + while true { + print("==> Result [y/n] ==> ", terminator: "") + guard let result = readLine() else { + continue + } + if result == "y" { + authorize = true + break + } else if result == "n" { + break + } + } + + guard let reply = xpc_dictionary_create_reply(msg) else { + return + } + xpc_dictionary_set_bool(reply, "result", authorize) + xpc_connection_send_message(conn, reply) +} +xpc_connection_resume(conn) + +dispatchMain() + -- 2.43.5