Compare commits

...

4 Commits

Author SHA1 Message Date
Max Goedjen
666374d174 Testing home directory 2023-11-12 11:30:49 -08:00
Max Goedjen
dbaa57a05a Fix EC384 value (#485) 2023-09-13 05:12:17 +00:00
Ricky Burgin
6248ecc9db Added FAQ item for generating RSA keys (#482) 2023-08-27 22:20:53 +00:00
Max Goedjen
d82bb80e14 Fix #478 (#479) 2023-08-13 22:02:45 +00:00
6 changed files with 24 additions and 5 deletions

4
FAQ.md
View File

@@ -32,6 +32,10 @@ Try running the "Setup Secretive" process by clicking on "Help", then "Setup Sec
Beginning with Secretive 2.2, every secret has an automatically generated public key file representation on disk, and the path to it is listed under "Public Key Path" in Secretive. You can specify that you want to use that key in your `~/.ssh/config`. [This ServerFault answer](https://serverfault.com/a/295771) has more details on setting that up. Beginning with Secretive 2.2, every secret has an automatically generated public key file representation on disk, and the path to it is listed under "Public Key Path" in Secretive. You can specify that you want to use that key in your `~/.ssh/config`. [This ServerFault answer](https://serverfault.com/a/295771) has more details on setting that up.
### How can I generate an RSA key?
The Mac's Secure Enclave only supports 256-bit EC keys, so inherently Secretive cannot support generating RSA keys.
### Can I use Secretive for SSH Agent Forwarding? ### Can I use Secretive for SSH Agent Forwarding?
Yes, you can! Once you've set up Secretive, just add `ForwardAgent yes` to the hosts you want to forward to in your SSH config file. Afterwards, any use of one of your SSH keys on the remote host must be authenticated through Secretive. Yes, you can! Once you've set up Secretive, just add `ForwardAgent yes` to the hosts you want to forward to in your SSH config file. Afterwards, any use of one of your SSH keys on the remote host must be authenticated through Secretive.

View File

@@ -60,7 +60,10 @@ extension SigningRequestTracer {
func iconURL(for pid: Int32) -> URL? { func iconURL(for pid: Int32) -> URL? {
do { do {
if let app = NSRunningApplication(processIdentifier: pid), let icon = app.icon?.tiffRepresentation { if let app = NSRunningApplication(processIdentifier: pid), let icon = app.icon?.tiffRepresentation {
let temporaryURL = URL(fileURLWithPath: (NSTemporaryDirectory() as NSString).appendingPathComponent("\(UUID().uuidString).png")) let temporaryURL = URL(fileURLWithPath: (NSTemporaryDirectory() as NSString).appendingPathComponent("\(app.bundleIdentifier ?? UUID().uuidString).png"))
if FileManager.default.fileExists(atPath: temporaryURL.path) {
return temporaryURL
}
let bitmap = NSBitmapImageRep(data: icon) let bitmap = NSBitmapImageRep(data: icon)
try bitmap?.representation(using: .png, properties: [:])?.write(to: temporaryURL) try bitmap?.representation(using: .png, properties: [:])?.write(to: temporaryURL)
return temporaryURL return temporaryURL

View File

@@ -249,7 +249,7 @@ extension SmartCard.Store {
case (.ellipticCurve, 256): case (.ellipticCurve, 256):
return .eciesEncryptionCofactorVariableIVX963SHA256AESGCM return .eciesEncryptionCofactorVariableIVX963SHA256AESGCM
case (.ellipticCurve, 384): case (.ellipticCurve, 384):
return .eciesEncryptionCofactorVariableIVX963SHA256AESGCM return .eciesEncryptionCofactorVariableIVX963SHA384AESGCM
case (.rsa, 1024), (.rsa, 2048): case (.rsa, 1024), (.rsa, 2048):
return .rsaEncryptionOAEPSHA512AESGCM return .rsaEncryptionOAEPSHA512AESGCM
default: default:

View File

@@ -16,14 +16,23 @@ class AppDelegate: NSObject, NSApplicationDelegate {
list.add(store: SmartCard.Store()) list.add(store: SmartCard.Store())
return list return list
}() }()
private static var homeDirectory: String {
// if UserDefaults.standard.bool(forKey: "usehomedirectory") {
let folder = "/Users/max/.secretive"
try? FileManager.default.createDirectory(atPath: folder, withIntermediateDirectories: false)
return folder
// } else {
// return FileManager.default.homeDirectoryForCurrentUser.path
// }
}
private let updater = Updater(checkOnLaunch: false) private let updater = Updater(checkOnLaunch: false)
private let notifier = Notifier() private let notifier = Notifier()
private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: NSHomeDirectory()) private let publicKeyFileStoreController = PublicKeyFileStoreController(homeDirectory: homeDirectory)
private lazy var agent: Agent = { private lazy var agent: Agent = {
Agent(storeList: storeList, witness: notifier) Agent(storeList: storeList, witness: notifier)
}() }()
private lazy var socketController: SocketController = { private lazy var socketController: SocketController = {
let path = (NSHomeDirectory() as NSString).appendingPathComponent("socket.ssh") as String let path = (AppDelegate.homeDirectory as NSString).appendingPathComponent("socket.ssh") as String
return SocketController(path: path) return SocketController(path: path)
}() }()
private var updateSink: AnyCancellable? private var updateSink: AnyCancellable?

View File

@@ -8,6 +8,8 @@
<true/> <true/>
<key>com.apple.security.smartcard</key> <key>com.apple.security.smartcard</key>
<true/> <true/>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array/>
<key>keychain-access-groups</key> <key>keychain-access-groups</key>
<array> <array>
<string>$(AppIdentifierPrefix)com.maxgoedjen.Secretive</string> <string>$(AppIdentifierPrefix)com.maxgoedjen.Secretive</string>

View File

@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 52; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@@ -878,6 +878,7 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = SecretAgent/SecretAgent.entitlements;
CODE_SIGN_STYLE = Manual; CODE_SIGN_STYLE = Manual;
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_ASSET_PATHS = "\"SecretAgent/Preview Content\""; DEVELOPMENT_ASSET_PATHS = "\"SecretAgent/Preview Content\"";