From 7d6223a327b65e2fca73ca592f09a6331e59bc89 Mon Sep 17 00:00:00 2001 From: Max Goedjen Date: Sun, 24 Aug 2025 14:05:24 -0700 Subject: [PATCH] Remove 1024 bit rsa --- Sources/Packages/Sources/SecretKit/KeychainTypes.swift | 2 +- .../Packages/Sources/SecretKit/OpenSSH/OpenSSHKeyWriter.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Packages/Sources/SecretKit/KeychainTypes.swift b/Sources/Packages/Sources/SecretKit/KeychainTypes.swift index c788573..75df0c3 100644 --- a/Sources/Packages/Sources/SecretKit/KeychainTypes.swift +++ b/Sources/Packages/Sources/SecretKit/KeychainTypes.swift @@ -58,7 +58,7 @@ public extension SecretStore { return .ecdsaSignatureMessageX962SHA256 case (.ecdsa, 384): return .ecdsaSignatureMessageX962SHA384 - case (.rsa, 1024), (.rsa, 2048): + case (.rsa, 2048): return .rsaSignatureMessagePKCS1v15SHA512 default: fatalError() diff --git a/Sources/Packages/Sources/SecretKit/OpenSSH/OpenSSHKeyWriter.swift b/Sources/Packages/Sources/SecretKit/OpenSSH/OpenSSHKeyWriter.swift index 5313f65..f07b269 100644 --- a/Sources/Packages/Sources/SecretKit/OpenSSH/OpenSSHKeyWriter.swift +++ b/Sources/Packages/Sources/SecretKit/OpenSSH/OpenSSHKeyWriter.swift @@ -115,7 +115,7 @@ extension OpenSSHKeyWriter { // [4 byte prefix][2 byte prefix][n][2 byte prefix][e] // Rather than parse out the whole ASN.1 blob, we know how this should be formatted, so pull values directly. let keySize = secret.keyType.size - guard secret.keyType.algorithm == .rsa && (keySize == 1024 || keySize == 2048) else { fatalError() } + guard secret.keyType.algorithm == .rsa && keySize == 2048 else { fatalError() } let length = secret.keyType.size/8 let data = secret.publicKey let n = Data(data[8..<(9+length)])