From fb323b3033f3a0fcd7d94f9e847f8601afeafc4e Mon Sep 17 00:00:00 2001 From: Dango Mango <33158127+darkang3lz92@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:29:41 +0800 Subject: [PATCH] fix cert parsing for ios 12 --- ios/Classes/Types/SecCertificate.swift | 5 +---- macos/Classes/Types/SecCertificate.swift | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ios/Classes/Types/SecCertificate.swift b/ios/Classes/Types/SecCertificate.swift index 06a17970..e7292f22 100644 --- a/ios/Classes/Types/SecCertificate.swift +++ b/ios/Classes/Types/SecCertificate.swift @@ -10,9 +10,6 @@ import Foundation extension SecCertificate { var data: Data { let serverCertificateCFData = SecCertificateCopyData(self) - let data = CFDataGetBytePtr(serverCertificateCFData) - let size = CFDataGetLength(serverCertificateCFData) - let certificateData = NSData(bytes: data, length: size) - return Data(certificateData) + return serverCertificateCFData as Data } } diff --git a/macos/Classes/Types/SecCertificate.swift b/macos/Classes/Types/SecCertificate.swift index 06a17970..e7292f22 100644 --- a/macos/Classes/Types/SecCertificate.swift +++ b/macos/Classes/Types/SecCertificate.swift @@ -10,9 +10,6 @@ import Foundation extension SecCertificate { var data: Data { let serverCertificateCFData = SecCertificateCopyData(self) - let data = CFDataGetBytePtr(serverCertificateCFData) - let size = CFDataGetLength(serverCertificateCFData) - let certificateData = NSData(bytes: data, length: size) - return Data(certificateData) + return serverCertificateCFData as Data } }