Skip to content

Commit c6273fa

Browse files
committed
Fix incorrect error code propagation in CodeSignatureInfo.load
In the CodeSignatureInfo.load method, when SecCodeCopySigningInformation fails, the code was incorrectly throwing MacError(result) instead of MacError(result2). This caused misleading error messages since it propagated the error code from the previous SecStaticCodeCreateWithPath call rather than the actual failing SecCodeCopySigningInformation call. The fix ensures accurate error reporting for code signing verification failures.
1 parent 3a6915e commit c6273fa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/SWBUtil/Signatures.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public struct CodeSignatureInfo: Codable, Sendable {
191191

192192
let result2 = SecCodeCopySigningInformation(code!, [SecCSFlags(rawValue: kSecCSSigningInformation)], &info)
193193
if result2 != 0 {
194-
throw MacError(result)
194+
throw MacError(result2)
195195
}
196196

197197
if !skipValidation {

0 commit comments

Comments
 (0)