- parent(Session::find(servicePort));
-
- secdebug("SS", "process %p(%d) changed session to %p", this, pid(), &session());
-}
-
-
-//
-// CodeSignatures implementation of Identity.
-// The caller must make sure we have a valid (not necessarily hash-able) clientCode().
-//
-string Process::getPath() const
-{
- assert(mClientCode);
- return mClientCode->canonicalPath();
-}
-
-const CssmData Process::getHash(CodeSigning::OSXSigner &signer) const
-{
- switch (mClientIdent) {
- case deferred:
- try {
- // try to calculate our signature hash (first time use)
- mCachedSignature.reset(mClientCode->sign(signer));
- assert(mCachedSignature.get());
- mClientIdent = known;
- secdebug("SS", "process %p(%d) code signature computed", this, pid());
- break;
- } catch (...) {
- // couldn't get client signature (unreadable, gone, hack attack, ...)
- mClientIdent = unknown;
- secdebug("SS", "process %p(%d) no code signature - anonymous", this, pid());
- CssmError::throwMe(CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION);
- }
- case known:
- assert(mCachedSignature.get());
- break;
- case unknown:
- CssmError::throwMe(CSSM_ERRCODE_INSUFFICIENT_CLIENT_IDENTIFICATION);
- }
- return CssmData(*mCachedSignature);