Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Gatekeeper only runs the first time something is downloaded and has nothing to do with it.

Codesigning does verify programs each time they are run and this has not changed in many OSes.



I checked this, but only got more confused. I made a copy of TextEdit, did all kinds of things with it (append some text to the executable, edited Info.plist and version.plist, threw away a zillion localizations, threw away the _CodeSignature directory), and never got Mountain Lion to complain. The mangled either launched or, in one case (I tried renaming the executable and adjusting the .plists to match), did not launch at all.

The only way I could get a code signing warning is by adding the com.apple.quarantine extended attribute (using xattr)

So, it looks like Mountain Lion only does a signing test for just downloaded apps, and then, I guess, only for downloads by applications that cooperate and set that flag.

I do think Apple has considered/is considering/would like to add more testing, though. Otherwise, I cannot explain the -P flag for codesign:

  -P, --pagesize pagesize
      Indicates the granularity of code signing. Pagesize must be a power of two.
      Chunks of pagesize bytes are separately signed and can thus be independently
      verified as needed.  As a special case, a pagesize of zero indicates that the
      entire code should be signed and verified as a single, possibly gigantic
      page. This option only applies to the main executable and has no effect on
      the sealing of associated data, including resources.


This is all by design, and you're surely right about Apple doing more with code signing in the future. In the past, signatures have mostly only been checked in very specific circumstances (e.g., designated requirements for two programs to be considered equivalent by Keychain and the firewall), though the architecture is fairly general, so third parties have been free to cook up their own applications. Still are, though there is no alternative to Developer ID for the Gatekeeper checks, which seems sensible from a KISS perspective, so long as reasonable workarounds exist for developers unwilling or unable to sign with a Developer ID (certainly true today).


The code-signing warning isn't a dialog, I think it just logs to Console.

It's more noticeable if the program was signed with entitlements (com.apple.private.*), some features might stop working then.


I don't think code was verified on launch before 10.8. I believe this because several Apple apps didn't verify (iTunes, and the Safari prerelease), and the only way I could tell was to verify at the command line. (Code with an invalid signature does give a message on 10.8.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: