Fix dumb mistake.

This commit is contained in:
Max Goedjen 2020-03-17 23:28:51 -07:00
parent 32f0ed88f4
commit 5a2d3ecc2e
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8
2 changed files with 7 additions and 3 deletions

View File

@ -16,6 +16,10 @@ extension SigningRequestProvenance {
chain.last! chain.last!
} }
public var intact: Bool {
return chain.reduce(true) { $0 && $1.validSignature }
}
} }
extension SigningRequestProvenance { extension SigningRequestProvenance {
@ -32,7 +36,7 @@ extension SigningRequestProvenance {
self.pid = pid self.pid = pid
self.name = name self.name = name
self.path = path self.path = path
self.validSignature = true self.validSignature = validSignature
self.parentPID = parentPID self.parentPID = parentPID
} }

View File

@ -34,9 +34,9 @@ struct SigningRequestTracer {
_ = proc_pidpath(pid, pathPointer, UInt32(MAXPATHLEN)) _ = proc_pidpath(pid, pathPointer, UInt32(MAXPATHLEN))
let path = String(cString: pathPointer) let path = String(cString: pathPointer)
var secCode: Unmanaged<SecCode>! var secCode: Unmanaged<SecCode>!
let flags: SecCSFlags = [SecCSFlags.considerExpiration, SecCSFlags.enforceRevocationChecks] let flags: SecCSFlags = [.considerExpiration, .enforceRevocationChecks]
SecCodeCreateWithPID(pid, SecCSFlags(), &secCode) SecCodeCreateWithPID(pid, SecCSFlags(), &secCode)
let valid = SecCodeCheckValidity(secCode.takeRetainedValue(), flags, nil) == ERR_SUCCESS let valid = SecCodeCheckValidity(secCode.takeRetainedValue(), flags, nil) == errSecSuccess
return SigningRequestProvenance.Process(pid: pid, name: procName, path: path, validSignature: valid, parentPID: ppid) return SigningRequestProvenance.Process(pid: pid, name: procName, path: path, validSignature: valid, parentPID: ppid)
} }