From 5449c3e83debeb2294691f31cfc3dc0368570d96 Mon Sep 17 00:00:00 2001 From: mrheltic Date: Mon, 16 Dec 2024 09:50:00 +0000 Subject: [PATCH] V0.6.5.d Arroyo Toad --- .../CustomCode/Utils/P256-keys-creation.swift | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/Sources/App/CustomCode/Utils/P256-keys-creation.swift b/Sources/App/CustomCode/Utils/P256-keys-creation.swift index 9b3f6a5..f9ce78d 100644 --- a/Sources/App/CustomCode/Utils/P256-keys-creation.swift +++ b/Sources/App/CustomCode/Utils/P256-keys-creation.swift @@ -36,7 +36,6 @@ public func fetchPrivateP256Key(deviceID: UInt) async throws -> P256.Signing.Pri // Do nothing } -<<<<<<< HEAD let key = createPrivateP256Key() @@ -58,31 +57,6 @@ public func fetchPrivateP256Key(deviceID: UInt) async throws -> P256.Signing.Pri let _ = try await URLSession.shared.upload(for: httpRequest, from: data) return key -======= - do { - let key = createPrivateP256Key() - - let publicKey = key.publicKey.pemRepresentation - - try privateP256_2_pem(privateKey: key).write(to: URL(filePath: keyFilePath), atomically: true, encoding: String.Encoding.utf8) - - - // UGLY: hardcoded - var httpRequest = URLRequest(url: URL(string: "http://public-key-db.internal/key")!) - httpRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") - httpRequest.httpMethod = "POST" - - let message = PublicKeyMessage(deviceID: deviceID, publicKey: publicKey) - let encoder = JSONEncoder() - let data = try encoder.encode(message) - httpRequest.httpBody = data - - let _ = try await URLSession.shared.upload(for: httpRequest, from: data) - return key - } catch { - throw ParsingError.ImpossibleToWriteKeyToFileSystem - } ->>>>>>> 5d78c9be5855d5541dd07b24d8331c018ddd2c70