<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Red Sweater Blog &#187; Articles</title>
	<atom:link href="http://www.red-sweater.com/blog/category/articles/feed" rel="self" type="application/rss+xml" />
	<link>http://www.red-sweater.com/blog</link>
	<description>Mac &#38; Technology Writings by Daniel Jalkut</description>
	<lastBuildDate>Tue, 15 May 2012 15:12:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Permanently Unhide Library</title>
		<link>http://www.red-sweater.com/blog/2448/permanently-unhide-library</link>
		<comments>http://www.red-sweater.com/blog/2448/permanently-unhide-library#comments</comments>
		<pubDate>Tue, 15 May 2012 14:20:32 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Macintosh]]></category>
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2448</guid>
		<description><![CDATA[When Apple shipped Mac OS X Lion 10.7, the &#8220;Library&#8221; folder located within every user&#8217;s home folder, which had previously been visible to users in the Finder, was made invisible. To access the Library folder, users must now hold down the option key while selecting the &#8220;Go&#8221; menu in the Finder. This is probably a [...]]]></description>
			<content:encoded><![CDATA[<p>When Apple shipped Mac OS X Lion 10.7, the &#8220;Library&#8221; folder located within every user&#8217;s home folder, which had previously been visible to users in the Finder, was made invisible. To access the Library folder, users must now hold down the <em>option</em> key while selecting the &#8220;Go&#8221; menu in the Finder.</p>
<p>This is probably a good move for the vast majority of Mac users, but for folks with even a small amount of interest in tinkering with the configuration files and caches of various applications, it&#8217;s an outright nuisance.</p>
<p>The nuisance is exacerbated by Apple&#8217;s decision to build in the &#8220;make invisible&#8221; action into every single dot-update to the OS. So if you&#8217;ve taken the trouble to undo Apple&#8217;s work and make the folder visible again, you&#8217;ll notice that when you updated from 10.7.3 to 10.7.4, <em>poof!</em>, it&#8217;s gone again.</p>
<p>I solved this very early on for my own needs by adding the command-line instructions for re-showing the Library folder to my Terminal configuration script. Every time I open a new Terminal window, the Library folder is aggressively set to visible again. In practice, this has meant that since 10.7 shipped, I&#8217;ve never been bothered once by Apple&#8217;s disappearing act.</p>
<p>For less Terminal-intensive Mac users, this solution might not be sufficient. If you, or somebody you love, truly wants the Library folder to be forever visible in the Finder, a good trick is to add a script Login item to do the deed. Here are detailed instructions for achieving this:</p>
<ol>
<li>Download  <a href="http://www.red-sweater.com/blog/wp-content/downloads/2012/05/UnhideLibrary1.zip" title="UnhideLibrary.zip" alt="UnhideLibrary">UnhideLibrary</a>. Make sure it unzips to a script application file after downloading. You&#8217;ll need to keep this file around, so I recommend storing it somewhere in your home folder.</li>
<li>Open System Preferences.</li>
<li>Click the Users &#038; Groups icon.</li>
<li>Select the Login Items tab for appropriate user.</li>
<li>Click the + icon and select the downloaded UnhideLibrary script item.</li>
<li>Log out and log back in again.</li>
<li>Never curse Apple&#8217;s Library folder policy again.</li>
</ol>
<p>The script file is just a few lines of AppleScript code to invoke the appropriate shell script. I originally used a plain shell script file but Thomas Borowski noticed it sometimes <a href="https://twitter.com/thomasborowski/status/202404757648850946">opens as a regular document</a> at login time. He also wrote <a href="http://mandogmachine.com/2012/05/unhide-your-user-library-folder-automatically/">his own post</a> essentially stating all the things I&#8217;m now repeating here!</p>
<p>So long Library folder, see you again, automatically, on 10.7.5.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2448/permanently-unhide-library/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>The Sandbox&#8217;s Big Red Button</title>
		<link>http://www.red-sweater.com/blog/2438/the-sandboxs-big-red-button</link>
		<comments>http://www.red-sweater.com/blog/2438/the-sandboxs-big-red-button#comments</comments>
		<pubDate>Sat, 12 May 2012 20:42:29 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2438</guid>
		<description><![CDATA[If you&#8217;ve been following the debate surrounding Apple&#8217;s Application Sandbox, you know that many developers are concerned about the implications for existing apps of adopting the sandbox. Apple has been threatening for almost a year that apps for sale in the Mac App Store will need to embrace the Application Sandbox, or else further updates [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve been following the debate surrounding Apple&#8217;s Application Sandbox, you know that many developers are concerned about the implications for existing apps of adopting the sandbox. </p>
<p>Apple has been threatening for almost a year that apps for sale in the Mac App Store will need to embrace the Application Sandbox, or else further updates to the apps will not be accepted. The deadline for adopting the sandbox has slipped several times, but it currently rests at <a href="https://developer.apple.com/news/index.php?id=02212012a">June 1, 2012</a>. That&#8217;s only a few weeks away, and comes just ahead of Apple&#8217;s annual developer conference.</p>
<p>I&#8217;ve written a few rants about the Application Sandbox, culminating in my February 2012 piece imploring Apple to <a href="">&#8220;Fix the Sandbox.&#8221;</a> Slowly but surely, they are improving the technology that drives the sandboxing features of Mac OS X, but by June 1, it appears that many classes of application will still be &#8220;unsandboxable&#8221; under the current permissions model supplied by Apple.</p>
<p>The shortage of permissions, or &#8220;entitlements&#8221; in sandbox lingo, has always been at the root of my concerns. Especially because of the political move requiring existing Mac App Store apps to adopt the sandbox, it is easy to imagine a features bloodbath come June, or whenever the requirement goes into place. When Apple announced the postponement to June 1, they also took care to make assurances that bug-fix updates would still be allowed for non-sandboxed apps, which is a nice break, but will still leave many apps to die on the vine in lieu of suitable sandboxing entitlements for the features various apps provide.</p>
<p>Apple publicly documents the <a href="http://developer.apple.com/library/ios/#DOCUMENTATION/Miscellaneous/Reference/EntitlementKeyReference/EnablingAppSandbox/EnablingAppSandbox.html">list of entitlements</a> available to Mac software developers. One of my major concerns has always been that because the list of entitlements doesn&#8217;t cover all the nuanced, legitimate tasks that an app might want to perform on a user&#8217;s behalf, that Application Sandbox ran the risk of permanently forbidding certain types of application behavior from being conducted in the sandbox.</p>
<p>The high-level list of Application Sandbox permissions is intentionally coarser-grained than the lower-level &#8220;sandbox facility&#8221; which ultimately imposes the restrictions. Some developers criticize Apple for failing to embrace the sanbdbox with their own apps, while expecting developers to embrace it for the Mac App Store. On Mac OS X 10.7.4, the two notably sandboxed apps from Apple remain Preview and TextEdit, two apps that would be relatively simple to sandbox compared to a large number of complex, 3rd party products.</p>
<p>But Apple has applied a good deal of sandboxing to their code. For example, take a look at /usr/share/sandbox/ and /System/Library/Sandbox/Profiles/ for examples a variety of &#8220;.sb&#8221; files that specify the sandbox restrictions of a variety of system services and tools. These files are expressed in SBPL, or the <a href="http://www.romab.com/ironsuite/SBPL.html">Sandbox Policy Language</a>, which is a scheme-based language used to express the <em>fine-grained permission</em> the sandbox facility is capable of controlling. See my <a href="http://www.red-sweater.com/blog/2170/sandbox-corners">&#8220;Sandbox Corners&#8221;</a> for a bit more about the lower-level sandbox facility and SBPL files.</p>
<p>Today I decided to take a closer look at one SBPL file of particular interest: <em>/System/Library/Sandbox/Profiles/application.sb</em>. This is the SBPL file that, so far as I can tell, translates the high-level &#8220;entitlements&#8221; of the Application Sandbox into corresponding lower-level policy expressions for the sandbox facility. For example:</p>
<pre>
(if (entitlement "com.apple.security.network.client")
    (allow network-outbound (remote ip)))
</pre>
<p>You can get a taste for how the high level &#8220;I&#8217;m a network client&#8221; translates specifically to &#8220;allow out bound ip traffic&#8221; at the sandbox facility level. Other high-level rules express much more complex logic. For example, the &#8220;I want to use the printer&#8221; entitlement translates to a variety of low-level permissions to communicate with printer-system daemons, and read from printer configuration files on the system.</p>
<p>But by far the most interesting entitlement of all is one that I found at the bottom of application.sb. It&#8217;s not documented on Apple&#8217;s site, and from what I can tell this blog post will become the first Google match on the term. The entitlement is &#8220;com.apple.security.temporary-exception.sbpl&#8221;, and the comment above it reads simply: &#8220;Big Red Button&#8221;.</p>
<pre>
;; Big Red Button
(sandbox-array-entitlement
  "com.apple.security.temporary-exception.sbpl"
  (lambda (string)
    (let* ((port (open-input-string string))
           (sbpl (read port)))
      (eval sbpl))))
</pre>
<p>This temporary entitlement enables a high-level Application Sandbox-restricted application to supply, along with whatever other high-level entitlements it requests, an entitlement that brings with it as a parameter a literal SBPL program, that will be evaluated and thus applied by the lower-level sandboxing facility. </p>
<p>In short: the Big Red Button gives Apple an out.</p>
<p>Whatever mistakes they make in the devising of high-level entitlements can be theoretically undone after-the-fact by supplying developers with special Big Red Button entitlements that pass along specific permissions to the lower-level sandbox, liberating the application to do whatever important task it needs to do.</p>
<p>Of course, the fact that this facility exists does not say anything about whether Apple will indulge its use. And just because you, as a developer, could use this entitlement key to empower your sandboxed app to <em>do practically anything</em>, it doesn&#8217;t mean that Apple&#8217;s App Store reviewers would look kindly upon it. In fact, I&#8217;m almost positive that at this point, any developer who submits a sandboxed app with this entitlement will have to have already conversed extensively with Apple about the need for such a transgression.</p>
<p>But the entitlement is there, and that makes me breathe a little easier. The Application Sandbox is, so far as I can tell, technically capable of granting whatever permission any app could reasonably need. The only obstacle, and it&#8217;s a big one at that, is the political challenge of App Store approval.</p>
<p><strong>Update:</strong> John Brayton made an interesting point in the comments, that regardless of MAS policy, the Big Red Button might be useful to non-MAS developers who wish to adopt the Application Sandbox , but can&#8217;t manage to squeeze all their functionality into the confines of its entitlements. I originally thought this made good sense, but then realized how risky a move this would be in practice. Because the entitlement in question here has not been documented by Apple, and is furthermore only listed in an implementation file for the system itself, the behavior of this entitlement can&#8217;t be relied upon.</p>
<p>Indeed, above I suggested that the entitlement would grant developers the power to enable virtually any capability in their sandboxed apps, but we have no idea how Apple has actually implemented support for the entitlement inside Apple. They could very well have a special case inside the SBPL language evaluator itself that looks for and rejects scripts that it doesn&#8217;t recognize as its own.</p>
<p>The application.sb file even has a strong disclaimer to this effect:</p>
<pre>
WARNING: The sandbox rules in this file currently constitute
Apple System Private Interface and are subject to change at any time and
without notice. The contents of this file are also auto-generated and
not user editable; it may be overwritten at any time.
</pre>
<p>In other words: you can&#8217;t count on the details of this file remaining stable from release to release. It would be foolish to base the behavior of any shipping app on entitlements listed there, but not documented by Apple. I think the Big Red Button is a very interesting find, and I&#8217;m very curious about it. But that&#8217;s how it should be considered: as a curiosity.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2438/the-sandboxs-big-red-button/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Secure Password Storage</title>
		<link>http://www.red-sweater.com/blog/2400/secure-password-storage</link>
		<comments>http://www.red-sweater.com/blog/2400/secure-password-storage#comments</comments>
		<pubDate>Tue, 20 Mar 2012 17:39:45 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2400</guid>
		<description><![CDATA[Tony Arcieri urges developers storing user-sensitive data, such as a passwords, not to use bcrypt (via Michael Tsai) for deriving the encryption key: The first cipher I&#8217;d suggest you consider besides bcrypt is PBKDF2. It&#8217;s ubiquitous and time-tested with an academic pedigree from RSA Labs, you know, the guys who invented much of the cryptographic [...]]]></description>
			<content:encoded><![CDATA[<p>Tony Arcieri urges developers storing user-sensitive data, such as a passwords, <em><a href="http://www.unlimitednovelty.com/2012/03/dont-use-bcrypt.html">not to use bcrypt</a></em> (via <a href="http://mjtsai.com/blog/2012/03/20/dont-use-bcrypt/">Michael Tsai</a>) for deriving the encryption key:</p>
<blockquote><p>The first cipher I&#8217;d suggest you consider besides bcrypt is PBKDF2. It&#8217;s ubiquitous and time-tested with an academic pedigree from RSA Labs, you know, the guys who invented much of the cryptographic ecosystem we use today.</p></blockquote>
<p>I was a little fuzzy on the distinction between <em>encryption techniques</em> such as AES, and the technology being discussed here, which is known as a <em>key derivation function</em>. Let&#8217;s break it down. With an encryption technique like AES you can use a large (e.g. 128 bits), difficult to guess private key to encrypt and decrypt data. But as a human, you can&#8217;t reasonably be expected to type in a random, 128-bit key in by hand when you want to access your data. The key derivation function is the code that takes your <em>relatively</em> easily-remembered password and derives a suitably monstrous, unpredictably random key from it. The quality and uncrackability of that key derivation is what Tony is questioning here.</p>
<p>I don&#8217;t know enough about encryption to have my own informed opinion about this. I tend to rely on the collective wisdom of the software industry, or on high-level service providers such as Apple, to suitably safeguard sensitive data in my apps. Tony included Apple&#8217;s FileVault full-disk-encryption in the list of technologies that use PBKDF2, which lent the technique an air of superiority in my mind. I know some of the folks behind Apple&#8217;s disk encryption, and they are careful, smart engineers. </p>
<p>I rely on FileVault for protection of my documents. But like most folks, I rely on Apple&#8217;s Keychain for the protection of passwords. I&#8217;m keenly interested to know if the Keychain is as secure as it reasonably can be, because I store not only my own passwords in it, but also e.g. my users&#8217; blogging passwords in their respective keychains.</p>
<p>AgileBits, developers of the popular secure-storage app 1Password, made a conscious decision <a href="http://help.agilebits.com/1Password3/os_x_keychain_history.html">not to use Apple&#8217;s Keychain</a>. They cite a variety of compelling reasons, including Keychain&#8217;s alleged use of a somewhat outdated <em>encryption technique</em> called Triple DES. Agile has <a href="http://help.agile.ws/1Password/agile_keychain_design.html">written extensively</a> about the design of their own keychain, in which they confirm that they are using PBKDF2 to derive their encryption keys.</p>
<p>I&#8217;m confident that Apple&#8217;s Keychain is secure <em>for all practical purposes</em>, but it is just sort of irksome if they are not adopting the very best protection that Mac-money can buy. Unable to find suitably authoritative documentation on the matter, I took to Apple&#8217;s open source for libsecurity_keychain, the library through which the Keychain&#8217;s data is managed. My reading of <a href="http://opensource.apple.com/source/libsecurity_keychain/libsecurity_keychain-55044/lib/SecKey.cpp">the source code</a> for a function called SecKeyDeriveFromPassword, does show that Apple is indeed using PBKDF2 to generate the key.</p>
<p>On 10.7.3 they are, at least. The SecKeyDeriveFromPassword API was new to 10.7, taking over for the older CSSM_DeriveKey. Perhaps the default behavior of that function did not use PBKDF2. In any case, it sure sounds as if on top of Tony&#8217;s urging, FileVault&#8217;s use, and 1Password&#8217;s adoption of PBKDF2, Apple&#8217;s decision to use it as the mechanism in their latest versions of the Keychain only adds to the impression that it&#8217;s a fine choice.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2400/secure-password-storage/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Developer ID Gotcha</title>
		<link>http://www.red-sweater.com/blog/2390/developer-id-gotcha</link>
		<comments>http://www.red-sweater.com/blog/2390/developer-id-gotcha#comments</comments>
		<pubDate>Mon, 19 Mar 2012 20:14:19 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Xcode]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2390</guid>
		<description><![CDATA[For the upcoming Gatekeeper feature in Mac OS X 10.8, Apple will make it easy for customers to prevent software from running that has not been digitally &#8220;signed&#8221; by developers with a certificate from Apple called the Developer ID certificate. Many developers already choose to sign software using self-generated signing certificates. I wrote many years [...]]]></description>
			<content:encoded><![CDATA[<p>For the upcoming <a href="http://www.apple.com/macosx/mountain-lion/security.html">Gatekeeper</a> feature in Mac OS X 10.8, Apple will make it easy for customers to prevent software from running that has not been digitally &#8220;signed&#8221; by developers with a certificate from Apple called the Developer ID certificate.</p>
<p>Many developers already choose to sign software using self-generated signing certificates. I <a href="http://www.red-sweater.com/blog/514/development-phase-code-signing">wrote many years ago</a> about the value of doing this for applications that access information from the user&#8217;s Keychain. With an unsigned application, every new version of your app needs the user&#8217;s approval to access the same keychain item (e.g. a blog password). But with a signed application, Apple allows a new version of the app <em>from the same signature authority</em> to continue accessing the keychain without nagging the user.</p>
<p>You might think that switching to Developer ID would be as simple as switching from the self-generated certificate to a certificate from Apple. I certainly assumed it would be, and so apparently did <a href="http://www.omnigroup.com/">The Omni Group</a> when they shipped a version of OmniFocus signed with their Developer ID certificate.</p>
<p>But there&#8217;s a catch. As The Omni Group&#8217;s own Ken Case <a href="https://twitter.com/#!/kcase/status/180789584878239744">pointed out on Twitter</a>, simply substituting the Apple certificate will lead to code signature validation failure on 10.6 and earlier systems:</p>
<blockquote class="twitter-tweet"><p>OmniFocus for Mac v1.10.1 is now available for those who were running into the keychain bug in our Developer ID builds on pre-Lion systems.</p>
<p>&mdash; Ken Case (@kcase) <a href="https://twitter.com/kcase/status/180789584878239744" data-datetime="2012-03-16T22:56:10+00:00">March 16, 2012</a></p></blockquote>
<p><script src="//platform.twitter.com/widgets.js" charset="utf-8"></script></p>
<p>What is the cause for this failure? I asked Ken and he kindly went into more detail over Twitter. I decided to elaborate on his response and to do some more research of my own. I&#8217;m sharing a summary of my findings here for the reference of other developers.</p>
<h3>Identity Confirmation</h3>
<p>Every item in the keychain has individual settings for how it may be accessed in the future. The desirable Keychain behavior of allowing an app continued access to keychain items painstakingly documented in an <a href="http://developer.apple.com/library/mac/#technotes/tn2206/_index.html">Apple tech note</a>, but the gist of it is that after gaining approval to access a keychain item from the user, an app will be allowed to continue accessing that item if it <em>is in fact the same app it claims to be.</em> The thinking here is, if the user indicated to the system that she trusts MarsEdit, then any future application that can prove it is also MarsEdit should inherit that same trust.</p>
<p>An app is determined to be itself by <em>meeting its <a href="http://developer.apple.com/library/mac/#technotes/tn2206/_index.html">designated requirement</a> (DR).</em> The DR is the list of policies, as specified within the code signature, for determining the authenticity of the app. The code signing process generates a default DR that is suitable for most applications. You can use the <em>codesign</em> command-line tool to examine the DR of any signed application on your Mac. For brevity, I&#8217;m omitting all output here except the DR:</p>
<pre>
% codesign -d -r- /Applications/MarsEdit.app

designated => identifier "com.red-sweater.marsedit" and
certificate root = H"3a3292a0f7b9b5f5492d956d8f561621fe446e51"
</pre>
<p>This makes sense. The app should be considered to be &#8220;MarsEdit&#8221; if it has the right bundle ID, and is <em>properly signed</em> by a certificate whose trust chain leads to a certificate with the listed SHA1 fingerprint. In this case, the certificate listed is the self-generated certificate I made a few years ago for Red Sweater&#8217;s apps. Since the certificate is embedded into the app by the code-signing process, the resuilting app is imminently verifiable and will &#8220;satisfy its own DR&#8221; on any Mac:</p>
<pre>
% codesign -dv /Applications/MarsEdit.app

/Applications/MarsEdit3.4.4.app: valid on disk
/Applications/MarsEdit3.4.4.app: satisfies its Designated Requirement
</pre>
<p>I never had a role in choosing the DR for MarsEdit. It was the default policy installed into my app by the codesign utility. I didn&#8217;t care about the DR, I just cared that users weren&#8217;t nagged about accessing the keychain on successive updates to my app. Thanks to Apple&#8217;s sensible defaults, it did in fact &#8220;just work.&#8221;</p>
<h3>A Betrayal Of Trust</h3>
<p>When I switched over to Apple&#8217;s Developer ID certificate, I continued to assume that Apple&#8217;s default signing behaviors would lead to reasonable behavior with regard the Keychain. And, for the most part, it does. Here is the DR for a version of MarsEdit that was signed with Apple&#8217;s certificate:</p>
<pre>
designated => identifier "com.red-sweater.marsedit" and
anchor apple generic and
certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */ and
certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and
certificate leaf[subject.OU] = "493CVA9A35"
</pre>
<p>Here the requirements take a <a href="https://developer.apple.com/library/mac/#documentation/Security/Conceptual/CodeSigningGuide/RequirementLang/RequirementLang.html">little more decoding</a> to make sense of. I&#8217;m learning as I go here but I&#8217;ll try to translate. The first line is pretty obvious, specifying the bundle ID. The other lines proceed to state requirements of the certificates in the signing trust chain. It identifies an anchor, certificate 1, and a leaf, so it expects three certificates in the chain in all. And specifically for these certificates it expects:</p>
<ol>
<li>The root certificate must be an &#8220;apple generic&#8221; certificate. This is a special certificate designation specifically documented by Apple as being any certificate &#8220;for code signed by Apple, including code signed using a signing certificate issued by Apple to other developers.&#8221; I take this to mean that the root must either be an Apple certificate or a Developer Developer ID Certification Authority certificate that Apple provided to me for signing my app.</li>
<li>Certificate 1 (the certificate in the middle of the trust chain) must have a particular field, which I was able to verify on my Mac exists in the &#8220;Developer ID Certification Authority&#8221; certificate.</li>
<li>The leaf (my private Developer ID certificate) must have a particular field, which I again verified exists in my certificate.</li>
<li>The leaf must also have a specific subject value of &#8220;493CVA9A35&#8243;, which I take to be the unique ID Apple assigned to me for my certificate.</li>
</ol>
<p>In short, the application must be signed with <em>my specific Developer ID certificate</em>, that certificate must be trusted by a certificate that has a special field indicating it&#8217;s a Developer ID authority, and that certificate must be trusted by Apple.</p>
<p>You can examine the certificate trust chain for a signed app with codesign:</p>
<pre>
% codesign -dvvv MarsEdit.app

Executable=/Volumes/daniel/Desktop/newmars/MarsEdit.app/Contents/MacOS/MarsEdit
Identifier=com.red-sweater.marsedit
Format=bundle with Mach-O universal (i386 x86_64)
CodeDirectory v=20100 size=4953 flags=0x0(none) hashes=241+3 location=embedded
Hash type=sha1 size=20
CDHash=f20bbe82230831579e301989faf2956a0142e838
Signature size=4234
<span style="color:green;">Authority=Developer ID Application: Red Sweater Software
Authority=Developer ID Certification Authority
Authority=Apple Root CA
</span>Signed Time=Mar 17, 2012 9:01:47 PM
Info.plist entries=31
Sealed Resources rules=4 files=149
Internal requirements count=1 size=260
</pre>
<p>I&#8217;ve highlighted the certificate chain in green. In this case, the trust chain has my Developer ID certificate as the leaf, the Apple Developer ID authority a step removed, and Apple&#8217;s Root CA a step above that. This all meshes nicely with the designated requirement rules we outlined above. So what&#8217;s the catch?</p>
<p>The catch is that the intermediate certificate is not likely to actually exist on any customer&#8217;s Mac. Because that&#8217;s a special certificate provided by Apple to developers, it&#8217;s only likely to be installed in the keychains of other developers. So when the Keychain goes to validate the app, it <em>does not</em> meet the designated requirement, so it is not trusted to inherit the access to the keychain.</p>
<p>A little bit that I still don&#8217;t completely understand is that apps that are signed in this way <em>are allowed access</em> on 10.7, even if the intermediate certificate is missing. I did just a small amount of research into this, but I think this has something to do with the new &#8220;SystemPolicy&#8221; file located at /var/db/SystemPolicy. It&#8217;s an sqlite3 file that you can freely examine. It&#8217;s where the system stores information about all the Gatekeeper signed apps on your Mac, but also where it maintains a list of what I think are high-level security overrides. Examining the SystemPolicy file on my 10.7 machine, I find a couple interesting &#8220;authority&#8221; elements:</p>
<pre>
INSERT INTO "authority" VALUES(4,1,'anchor apple generic and
certificate 1[field.1.2.840.113635.100.6.2.6] exists and
certificate leaf[field.1.2.840.113635.100.6.1.13] exists',
1,NULL,0.0,'Developer Seed',NULL,0,NULL);

INSERT INTO "authority" VALUES(5,2,'anchor apple generic and
certificate 1[field.1.2.840.113635.100.6.2.6] exists and
certificate leaf[field.1.2.840.113635.100.6.1.14] exists',
1,NULL,0.0,'Developer Seed',NULL,0,NULL);
</pre>
<p>Since Apple&#8217;s security code is open sourced, you can actually poke around at <a href="http://opensource.apple.com/source/libsecurity_codesigning/libsecurity_codesigning-55032/">libsecurity_codesigning</a> and try to make some sense of it. I don&#8217;t want to get too sucked into this curiosity, but I was able to confirm that the items above specify &#8220;authority&#8221; policies for running applications, and for installing applications. I was also able to confirm these are <a href="http://opensource.apple.com/source/libsecurity_codesigning/libsecurity_codesigning-55032/lib/syspolicy.sql">included in the source code</a> to libSecurity, so they weren&#8217;t added on my system as a result of anything I did.</p>
<p>The naming of those items, &#8220;Developer Seed&#8221;, is pretty interesting. I speculate that Apple  knows that the certificate chain for Developer ID-signed applications will not validate, and so they added these high level overrides in 10.7 so that we can test our signed applications, and so that customers can run them without incident. The only problem is there is no such workaround on 10.6 and earlier systems.</p>
<h3>Getting Back To Basics</h3>
<p>In order for our Developer ID-signed applications to work as expected on 10.6 or earlier, the designated requirement has to be met. Since the odds of the default DR being met are low, we need to override Apple&#8217;s default DR and install a simpler one that self-verifies with rules more along the lines of the way our self-generated certificate did it.</p>
<p>As Ken Case pointed out in his tweets, you can do this by specifying the requirements information explictily on the command line:</p>
<pre>
% codesign -f --sign "Developer ID"
  -r='designated => certificate leaf H"xxx" and
  identifier "com.red-sweater.marsedit"' MarsEdit.app
</pre>
<p>(Split into three lines for readability on my blog. It should all be on one line.)</p>
<p>This will sign the app using your Keychain-installed Developer ID certificate from Apple, but it will specify the given explicit DR. The xxx string is replaced by the SHA1 fingerprint for your Developer ID signing certificate, which you can find by examining the certificate in the Keychain Access app and looking at the very bottom.</p>
<p>Now, when the Keychain validates the designated requirement on either Mac OS X 10.7 or 10.6, it passes the test.</p>
<h3>A Proper Solution</h3>
<p>I have some concerns about working around the problem using this custom, dumbed down designated requirement. Sure, it&#8217;s no &#8220;dumber&#8221; than the self-generated signature&#8217;s DR, but what concerns me is whether Apple&#8217;s support for Gatekeeper in 10.8 will make assumptions about an app&#8217;s, ahem, Gateworthiness, based on some of those semi-magical certificate field checks in the problematic DR. If I&#8217;m correct in my guesses about how those SystemPolicy entries work, then there is already &#8220;magical&#8221; behavior happening in 10.7 for Developer ID signed apps. Who&#8217;s to say there won&#8217;t be continued magic going forward?</p>
<p>I&#8217;m not sure what the right fix is. Maybe it&#8217;s just this, dumbing down the requirements string. But it would be nice if Apple&#8217;s default code-signing requirements &#8220;just worked&#8221;&#8230;</p>
<p>Hey, wait. Why does this version of my app built with Xcode 4.3 &#8220;just work&#8221;? All of my shipping apps are currently built using Xcode 3 on a 10.6 machine. All of the examples above are based on analysis of an app that has been code-signed in that environment. But when I look at a version of my app built Mac OS X 10.7, and with Xcode 4.3, the requirements are a little different:</p>
<pre>
designated => anchor apple generic and
identifier "com.red-sweater.marsedit" and
(<span style="color:green;">certificate leaf[field.1.2.840.113635.100.6.1.9] /* exists */ or
certificate 1[field.1.2.840.113635.100.6.2.6] /* exists */</span> and
certificate leaf[field.1.2.840.113635.100.6.1.13] /* exists */ and
certificate leaf[subject.OU] = "493CVA9A35")
</pre>
<p>I&#8217;ve highlighted in green the part that is different from my old DR. Where it used to require that intermediate Developer ID authority certificate that is missing from most Macs, it now requires either that certificate OR that a field in my Developer ID signing certificate exists. This effectively restores the passing status of the DR on any Mac, whether it has an intermediate installed, or whether or not there are any alleged funky overrides going on in SystemPolicy.</p>
<p>So, my recommended fix either to use Xcode 4.3 to build your app, or mimic Xcode 4.3&#8242;s code signing behavior by stealing its <em>codesign</em> arguments (look in the build log after building on 4.3) and applying them verbatim in your build process.</p>
<p>I&#8217;ve learned a whole lot about code signing and certificates today. If you got to the bottom of this post, I hope that you have too. In any case, this should give you a good idea of a situation you need to be aware of, and test against: if you are signing your app with Developer ID, and need to run on 10.6 or earlier, make sure the Keychain is still kind to your app.</p>
<h3>Update: Now With More Facts</h3>
<p>My conclusions above were based on some false assumptions on my part about how designated requirements are synthesized and how the certificate validation process actually works. Based on some valuable comments from Chris Suter and Evan Schoenberg I think it&#8217;s fair to say the root problem here is that &#8220;default&#8221; DR synthesis is actually just a placeholder that allows the host system to insert whatever default it thinks is suitable for the app. This explains a weird thing that I thought may have just been a bug: that the designated requirement showed up differently on 10.6 than on 10.7. It turns out this reflects the fact that if you don&#8217;t specify a specific DR, the system will do it&#8217;s best to make sense of your app (maybe based on its signatures to some extent?).</p>
<p>So, I&#8217;m not 100% fact based yet, but I think the new moral of the story is: if you need to run earlier than 10.7, specify your DR literally because the default DR generated for a Developer ID certificiate will not work perfectly on 10.6 and earlier.</p>
<h3>Update: Now With <strong>Even More Facts</strong></h3>
<p>My friends at Fetch Softworks went <a href="http://fetchsoftworks.com/fetch/blog/gatekeeper-vs-leopard-an-ongoing-tale">even deeper on this issue</a>, discovering that Apple&#8217;s own code-signing defaults for Mac App Store submissions offer a useful clue for a better, more generalized designated-requirement for Gatekeeper-signed apps. In a nutshell: you want to key the designated requirement off of your developer ID being listed in the certificate, rather than a precise fingerprint of a certificate.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2390/developer-id-gotcha/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>The End Of Advertising</title>
		<link>http://www.red-sweater.com/blog/2367/the-end-of-advertising</link>
		<comments>http://www.red-sweater.com/blog/2367/the-end-of-advertising#comments</comments>
		<pubDate>Thu, 01 Mar 2012 04:47:14 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Marketing]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2367</guid>
		<description><![CDATA[Dave Winer writes about the intermingling of of tech and advertising (via Brent Simmons): The tech industry has been absorbed by the ad industry, and vice versa. However, there is, imho, still room for a tech industry that is not merged with the ad industry. I&#8217;ll take this a step further: advertising is on the [...]]]></description>
			<content:encoded><![CDATA[<p>Dave Winer writes about <a href="http://scripting.com/stories/2012/02/29/bookmark.html">the intermingling of of tech and advertising</a> (via <a href="http://inessential.com/2012/02/29/ads_and_tech">Brent Simmons</a>):</p>
<blockquote>
<p>The tech industry has been absorbed by the ad industry, and vice versa.</p>
<p>However, there is, imho, still room for a tech industry that is not merged with the ad industry.</p>
</blockquote>
<p>I&#8217;ll take this a step further: advertising is on the way out. Technology loathes a middle-man, and advertising as an industry is the king of all middle-men. The purpose of advertising is to connect customers with companies, so as to facilitate a transfer of money in exchange for goods or services. As time goes by, customers and companies will be more and more capable of achieving this on their own.</p>
<p>In the history of the world so far, there has been considerable opportunity for advertisers to misguide customers, and to lure their money toward products or services that can be framed as perfect for them, even when they are not. That&#8217;s the art and the holy grail of advertising. But going forward, technology will offer customers and companies the tools to connect effortlessly, optimizing for compatibility without the help of the bogus, outdated advertising system.</p>
<p>Most of us base purchasing decisions on vague hunches derived from a mix of advertising influences, word-of-mouth, and the relative trendiness of a product. But more and more as customers we are cutting out the advertising middle-man, in favor of systems based on education and trust. Amazon is a good example of this. With the notable exception of their Kindle line of products, they have little concern about which products their customers buy. It only matters that they buy things, and that they buy things often. They provide detailed product information, and allow honest, often scathing reviews. The goal is for customers to make self-serving decisions. In this case, defying the advertisers&#8217; best interests is in Amazon&#8217;s best interest as well.</p>
<p>Extrapolate the technology-assisted consumption process out over the next 10, 50, 100 years, and I have a hard time imagining a meaningful role for conventional advertising. If I search Google for &#8220;lawnmower,&#8221; it&#8217;s not interesting that some tractor company has paid Google for the privilege of putting their brand&#8217;s information at the top of the list. At some point in the future, customers will assume that companies who choose to advertise conventionally are afraid of the outcome when consulting various self-empowering resources. Where am I more likely to search for &#8220;lawnmower?&#8221; If I want to know <em>what a lawnmower is</em>, Google. If I want to know <em>which lawnmower to buy</em>? Amazon, or another site that strives to empower customers, not advertisers.</p>
<p>I do worry about what happens to some of our beloved, advertising-driven services. We&#8217;ve all grown accustomed to the subsidization of news reporting and analysis. In recent decades, advertising has crept further into our lives, even subsidizing municipal infrastructures such as public transit. What impact will the end of advertising have on these important services?</p>
<p>In the old world, technology for connecting customers directly to companies did not exist, so companies were satisfied in buying advertising. It is tool that serves to expose customers to the concept of a product, and to crudely attempt to educate them about the suitability of the product for their purposes.</p>
<p>In the new world, mass-exposure will be replaced by social networking, and education will be not only replaced by, but massively bolstered by trusted systems such as Amazon&#8217;s review database, Consumer Reports, and other <em>much better</em> stuff that is presumably coming in the future. Presumably? It has to be coming, and it has to be better, because everything&#8217;s riding on it.</p>
<p>Everything&#8217;s riding on it because <em>this</em> is the salvation for current advertising-subsidized industries. They will shift from being exposure-focused, to education-focused. Amazon, Apple, and many others already offer affiliate systems that reward anybody who can produce a sale. The old way to produce a sale is by blasting customers with unwanted information until you happen upon something that sticks. The new way is to provide customers with a trustworthy, opt-in system for determining what&#8217;s <em>best for the customer</em>. To stay alive in the changing world, these subsidized industries will change their business plans, or go out of business.</p>
<p>Earlier today, before I even followed Brent&#8217;s link to Dave&#8217;s piece, I read this short, <a href="http://thisisnthappiness.com/post/18484101058/newstoday?976e2b80">thought-provoking essay</a>, allegedly by the graffiti artist Banksy. Here is an excerpt that I think is pertinent to my predictions here:</p>
<blockquote>
<p>They have access to the most sophisticated technology the world has ever seen and they bully you with it. They are The Advertisers and they are laughing at you.</p>
<p>&#8230;</p>
<p>You owe the companies nothing. Less than nothing, you especially don’t owe them any courtesy. They owe you. They have re-arranged the world to put themselves in front of you. They never asked for your permission, don’t even start asking for theirs.</p>
</blockquote>
<p>As a businessman who is dedicated to my own commercial success, I embrace the challenge of getting the word out to potential customers. I will shout my message from the rooftops to anybody who will listen. But <em>only</em> to those who will listen. I don&#8217;t want to annoy, interrupt, cajole, or appeal to a customer&#8217;s feelings of inferiority. I don&#8217;t want a customer to choose my product over a competitor&#8217;s <em>unless it&#8217;s better for them</em>. In short: I want a future without advertising, where my products sell themselves through word-of-mouth and through trusted systems that educate customers about making the right choice for them. Not what&#8217;s right for companies, and certainly, so long as they&#8217;re still around, not what&#8217;s right for advertisers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2367/the-end-of-advertising/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Fix The Sandbox</title>
		<link>http://www.red-sweater.com/blog/2324/fix-the-sandbox</link>
		<comments>http://www.red-sweater.com/blog/2324/fix-the-sandbox#comments</comments>
		<pubDate>Fri, 17 Feb 2012 20:53:27 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2324</guid>
		<description><![CDATA[Apple&#8217;s getting a lot of press this week about their forthcoming 10.8 &#8220;Mountain Lion&#8221; update to Mac OS X. One of its key features will be a security feature called &#8220;Gatekeeper&#8221; that will allow users to avoid launching apps from developers who are not registered with Apple. If you are not already familiar with Gatekeeper, [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s getting a lot of press this week about their forthcoming 10.8 &#8220;Mountain Lion&#8221; update to Mac OS X. One of its key features will be a security feature called &#8220;Gatekeeper&#8221; that will allow users to avoid launching apps from developers who are not registered with Apple. If you are not already familiar with Gatekeeper, read <a href="http://www.panic.com/blog/2012/02/about-gatekeeper/">Steven Frank&#8217;s writeup</a> to get up to speed. You should also check out <a href="http://blog.wilshipley.com/2011/11/real-security-in-mac-os-x-requires.html">Wil Shipley&#8217;s post</a> from this past November, where he argued for something very much like Gatekeeper.</p>
<p>I am excited about Gatekeeper not only because it will improve security on the Mac but because of how it will achieve this goal. Apple, as the authority in the OS X environment, will convey information to Mac users about who developed a particular application, <em>empowering them to protect themselves</em>. Compare this to the status quo of the App Store, where security is completely out of users&#8217; hands, and Apple uses <em>its discretion</em> to protect users from software it judges unfit for consumption.</p>
<h3>Who vs. What</h3>
<p>Simply establishing the identities of software developers is a major step for increasing security, because bad actors can either be immediately shut down, or at least prevented from further propagating on the platform. If &#8220;Hawt Dawg Industries&#8221; is discovered to be a malware developer, Apple can flip a switch and any user who trusts Apple&#8217;s opinion about such things can automatically prevent their Macs from trusting software from that vendor.</p>
<p>If somebody knocks on your door in the middle of the night, the first thing you&#8217;re liable to ask is &#8220;Who are you?&#8221; That&#8217;s Gatekeeper. Sometimes, the &#8220;who&#8221; is all the information you need. But if there&#8217;s any doubt, the next bit of information you&#8217;ll pry for is &#8220;What do you want?&#8221; <a href="http://www.red-sweater.com/blog/2170/sandbox-corners">That&#8217;s the sandbox</a>. At least, it&#8217;s what the sandbox will be, after Apple fixes it.</p>
<h3>The Broken Sandbox</h3>
<p>At its best sandboxing is a means for app developers to <em>faithfully state their intentions</em> in a manner that can be evaluated by users, and also be reliably enforced by the operating system. So if your new &#8220;Fun on Facebook&#8221; app declares its intention is to connect to the web, you might judiciously allow it. If it says it needs to write files to the root of the filesystem, you&#8217;d be wise to search for another app.</p>
<p>Sandboxing on the Mac works by providing developers with a standardized list of &#8220;entitlements&#8221; which are clear descriptions of things it would like to do on your Mac. Examples include: access the internet, read files from your Pictures folder, print things on your printer.</p>
<p>The number one broken thing about sandboxing as it stands today, is the list of entitlements is simply too limited. Many apps on the App Store, including my own, will need to have their functionality considerably diminished, or in some cases made outright useless, in order to accommodate the available list of entitlements that sandboxing offers.</p>
<p>To stretch the stranger-at-your-door metaphor a little further, imagine the visitor is your trusted plumber, who&#8217;s come to fix a leaking pipe. In response to &#8220;What do you want?&#8221; he&#8217;s a bit tongue-tied. There&#8217;s no &#8220;entitlement&#8221; for fixing pipes, so he&#8217;s forced to say &#8220;I&#8217;m here for a chat.&#8221; When you reluctantly let him in the door he informs you that actually, due to recent legal changes, he&#8217;s no longer allowed to fix your pipes.</p>
<p>The impending state of the Mac App Store is very much like this. A great number of apps provide useful services to grateful customers, but as those services don&#8217;t fit the mould of Apple&#8217;s sandboxing entitlements, they will be effectively barred from the store within a few weeks. If you want to hire somebody to &#8220;fix the leaky pipe,&#8221; you&#8217;ll have to look outside the store, where apps are not sandboxed at all, and where Apple is in no position to improve users&#8217; knowledge about the &#8220;what&#8221; of an app.</p>
<h3>Saving Face</h3>
<p>Gatekeeper is extremely simple, yet is likely to be extremely effective. Some exasperated developers who have been frustrated by the sandbox limitations are hopeful that all this attention on Gatekeeper might indicate a change of heart on Apple&#8217;s part. Will they see the error of their ways and ditch sandboxing in favor of Gatekeeper&#8217;s elegance?</p>
<p>One problem with this approach is that Apple would appear as though it had stumbled in its strategy. It spent the greater part of a year selling the idea of sandboxing and all of its merits, then two weeks before its grand debut, jumps ship for a completely different approach? Smooth move, Apple.</p>
<p>But a more important problem is that abandoning sandboxing would mean the significant engineering investment, both by Apple and by developers who have refactored their apps to satisfy sandboxing requirements, would have been a waste. <em>There is such great value in sandboxing technology,</em> we just need to finish the job of mining it out.</p>
<p>What should Apple do about all this? Gatekeeper and the Mac App Sandbox are both technologies that stand to improve security on the Mac by labeling apps with useful information about their developers and their functionality. The extent to which security is improved is very much tied to how widely adopted these technologies are. If the vast majority of developers agree to sign their apps with Gatekeeper certificates, then the vast majority of users will leave the Gatekeeper &#8220;safe&#8221; mode enabled.</p>
<h3>Embrace, Expand, and Empower</h3>
<p>Apple should <strong>embrace the utility of sandboxing</strong> by shifting their focus away from sandboxing only Mac App Store titles, to a strategy that would sandbox virtually every Mac app, inside the store or out. Given the current limitations of sandboxing, a significant number of developers <em>will not adopt the technology</em>, so its usefulness to users and to the security of the platform will be diminished. Apple can turn that around so that sandboxing is a worthy counterpart to Gatekeeper, and a technology that any developer in his or her right mind would feel foolish not to incorporate.</p>
<p>To increase adoption, Apple should <strong>expand the current list of entitlements</strong> until it covers every reasonable behavior that users expect from Mac apps. A good test for this is any app that is currently available in the Mac App Store. Having been approved by Apple&#8217;s own reviewers, and purchased by Apple&#8217;s own customers, the merit of these apps should be considered implicit. If a Mac App Store app&#8217;s reasonable behavior cannot be achieved in the confines of the sandbox, it should be considered a sandboxing bug, and a new entitlement should be added.</p>
<p>Finally, Apple should take a cue from its own Gatekeeper approach. By incorporating sandbox information about apps into the forthcoming app security preference pane, they will <strong>empower users to understand application intentions</strong>. Along with the proposed options controlling the &#8220;who&#8221; of apps, users would be given reasonable defaults pertaining to the &#8220;what&#8221; of apps. For power users, these settings would be configurable on an entitlement-by-entitlement basis. The sheer transparency will be yet another motivation for developers to adopt sandbox, and for users to demand sandboxing from their developers.</p>
<p>Imagine a future where the majority of Mac apps are signed with Gatekeeper certificates, and an accurate list of entitlements. Users will be protected by smart default settings, and by the knowledge of who their apps come from, as well as what they intend to do. Developers will be protected from their own unintentionally destructive mistakes, and from impostors selling software purported to be authentic. And Apple? Apple will be remembered as the huge, clever computer company that solved the software security problem on two fronts, <em>without pissing off developers or customers</em>. Much.</p>
<p>(This piece was inspired by a lunchtime chat with my friend <a href="http://www.onefoottsunami.com/">Paul Kafasis</a>. Thanks, Paul!)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2324/fix-the-sandbox/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Learn To Code</title>
		<link>http://www.red-sweater.com/blog/2298/learn-to-code</link>
		<comments>http://www.red-sweater.com/blog/2298/learn-to-code#comments</comments>
		<pubDate>Mon, 02 Jan 2012 04:20:35 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2298</guid>
		<description><![CDATA[If learning to program is even a minor goal for you, Code Year (via Brent Simmons) might be just the encouragement you need. They promise to email you on a weekly basis with coding lessons to help you achieve your goal. I&#8217;m one of those computer programmers who downplays the difficulty of the profession, because &#8220;if I [...]]]></description>
			<content:encoded><![CDATA[<p>If learning to program is even a minor goal for you, <a href="http://codeyear.com/">Code Year</a> (via <a href="http://inessential.com/2012/01/01/code_year">Brent Simmons</a>) might be just the encouragement you need. They promise to email you on a weekly basis with coding lessons to help you achieve your goal.</p>
<p>I&#8217;m one of those computer programmers who downplays the difficulty of the profession, because &#8220;if I can do it, anybody can do it!&#8221; On the other hand, I have faced challenges that made me question whether I&#8217;m vaguely qualified for the job. What it boils down to is that programming is both incredibly simple and impossibly hard, like so many important things in life.</p>
<p>There was a time when nobody knew how to write literary prose. The geniuses who invented it shared their special tool with a few friends, and they relished in their private, elite communications. Eventually monks, politicians, and academics joined the club. Now, we judge a society&#8217;s overall level of intellectual advancement by the literacy rate: the percentage of people who have learned to read and write.</p>
<p>Literacy isn&#8217;t about becoming a Hemingway or a Chabon. It&#8217;s about learning the basic tools to get a job done. I think programming — coding — is much the same. You don&#8217;t have to be the world&#8217;s best programmer to develop a means of expressing yourself, of solving a problem, of making something happen. If you&#8217;re lucky, you&#8217;ll be a  genius, but you start out with the basics.</p>
<p>Long ago, it would have been ridiculous to assume a whole society could be judged by its ability to read and write prose. It feels ridiculous now, to assume that we might use computer programming as a similar benchmark. Yet it may happen.</p>
<p>Did you always mean to learn another language, but never did? By all means, learn Spanish, French, or Chinese. But learn to code, too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2298/learn-to-code/feed</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>You Sense It Or You Don&#8217;t</title>
		<link>http://www.red-sweater.com/blog/2280/you-sense-it-or-you-dont</link>
		<comments>http://www.red-sweater.com/blog/2280/you-sense-it-or-you-dont#comments</comments>
		<pubDate>Thu, 15 Dec 2011 19:42:23 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2280</guid>
		<description><![CDATA[I enjoyed Joshua Topolsky&#8217;s rebuttal to the high-fives exchanged between John Gruber and MG Siegler about the Galaxy Nexus allegedly being less polished than iPhones are. I didn&#8217;t pick up on some of the cringe that Joshua pointed out, in particular the implication that rich people who have &#8220;nicer&#8221; stuff will always enjoy some impossible [...]]]></description>
			<content:encoded><![CDATA[<p>I enjoyed <a href="http://www.theverge.com/2011/12/15/2638611/horseshit">Joshua Topolsky&#8217;s rebuttal</a> to the high-fives exchanged between <a href="http://daringfireball.net/linked/2011/12/14/siegler">John Gruber</a> and <a href="http://techcrunch.com/2011/12/14/iphone-galaxy-nexus-review/">MG Siegler</a> about the Galaxy Nexus allegedly being less polished than iPhones are. I didn&#8217;t pick up on some of the cringe that Joshua pointed out, in particular the implication that rich people who have &#8220;nicer&#8221; stuff will always enjoy some impossible to crack understanding of the finer things in life.</p>
<p>And yet John and MG are totally right. You either see it or you don&#8217;t. This is egalitarian, relating to all facets of life, in every nuanced area of preference or priority. For whatever details a given person appreciates and values, far more people will be disinterested and be unlikely to even distinguish differences. How about those Android aficionados? They&#8217;ll point to the flexibility afforded by true multitasking, freedom to install unapproved apps, etc. They shake their heads at silly iPhone lovers, hold their phones up high and take pride in these qualities. To them, these <em>are</em> the finer points. This is the &#8220;polish.&#8221; The rest of us just don&#8217;t see it.</p>
<p>For many of us who make, use, or write about software for a living, polish is all about removing from the software as many jarring behaviors as possible. Sweating the small stuff. It&#8217;s exactly the details like the persistently stuttering scrolling that MG points out that continue to make Android products appear less polished to us. It&#8217;s seriously unnerving. <strong>It&#8217;s a big freaking deal to us, while other people just don&#8217;t see it.</strong></p>
<p>It doesn&#8217;t have to relate to expense, and isn&#8217;t restricted to a <em>premium class</em> of product. It&#8217;s also, of course, not restricted to vision. I can imagine some of my wine-loving friends holding up a $15 bottle of something precious they&#8217;d discovered, while expressing disdain for a $200 bottle of swill that somebody else just adores. Nor does it need to be something &#8220;high class.&#8221; I&#8217;m sure a number of hard-working farmworkers could explain to me in agonizing detail why I picked the absolute worst rake and shovel for my garden.</p>
<p>If you&#8217;ve got a taste for something, a nose for something, an eye for something, an ear for something, a <em>feel</em> for something, and you find a product that soothes that sense, then you have a special gift: the ability to cast judgement on inferior efforts. Other folks? They&#8217;ll either sense it too, or they won&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2280/you-sense-it-or-you-dont/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How To Talk Dirty</title>
		<link>http://www.red-sweater.com/blog/2266/how-to-talk-dirty</link>
		<comments>http://www.red-sweater.com/blog/2266/how-to-talk-dirty#comments</comments>
		<pubDate>Wed, 09 Nov 2011 20:18:29 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2266</guid>
		<description><![CDATA[Today there is much chatter on Twitter about Brittany Tarvin&#8217;s A Letter to the Developer Community. In a nutshell: Brittany attended MacTech last week, and was offended by the unprofessional vibe in a few instances, but in particular, with regard to sexual jokes that comprised the content of one. It reads to me less like [...]]]></description>
			<content:encoded><![CDATA[<p>Today there is much chatter on Twitter about Brittany Tarvin&#8217;s <a href="http://wildchocolate.tumblr.com/">A Letter to the Developer Community</a>. In a nutshell: Brittany attended <a href="http://www.mactech.com/conference/about">MacTech</a> last week, and was offended by the unprofessional vibe in a few instances, but in particular, with regard to sexual jokes that comprised the content of one. It reads to me less like she was less personally offended than surprised and disappointed by the behavior of her peers. My takeaway after reading her piece is that she feels juvenile humor simply does not have a place at a professional conference.</p>
<p>Judging by the massive response on Twitter in support of her opinion, I think that most people tend to agree. However, I think that the vagueness of her description of the incident leaves much to the imagination, and is causing people to leap to condemnation of the talk, the conference, and the industry. I am not saying the condemnation is unwarranted, but my feelings about this particular event are complicated, and I think yours might be too, if you knew more of the details.</p>
<p>The talk in question was titled <a href="http://www.mactech.com/conference/sessions">The Ten Dirty Words and How To Use Them</a>. The talk was given by my friend <a href="http://www.notesfromandy.com/">Andy Lee</a>, and his synopsis from the conference session descriptions reads:</p>
<blockquote>
<p>In 2003, I came up with &#8220;The Top Ten Cocoa Words That Sound Dirty But Aren&#8217;t.&#8221; By finding APIs via this arbitrary way, we talk a random stroll through Cocoa, which can stimulate curiosity and lead to new discoveries and new questions. What would you guess NSInsertionPosition is for? (I incorrectly guessed text editing.) It can also be worthwhile reviewing familiar ground. We all autorelease &#8212; some of us every day &#8212; but it may still be possible to learn a thing or two about it. I will talk about the proper use of each word in the list.</p>
</blockquote>
<p>To give you a more specific idea of the offensiveness of the API method names that Andy discussed, take a look at his blog post <a href="http://www.notesfromandy.com/2011/05/14/ten-cocoa-words-plus-two/">listing the API methods</a> under discussion. [<strong>Update: </strong>MacTech has just posted <a href="http://www.mactech.com/sites/default/files/Lee-Ten_Dirty_Words_and_How_to_Use_Them.pdf">slides from the talk</a>.]</p>
<p>The genius of this talk is it takes a running gag in the Cocoa community, that occasional API names here and there were unfortunately named, and runs with that gag as a scaffolding for exploring the specific APIs in more detail. As for the sexual jokes, I think they basically write themselves in the individual minds of the audience. As anybody who has sat through an all-too-dry conference talk about the specific technical blah, blah, blah of any subject can attest, it is generally a good idea to <em>inject some humor</em> into a talk&#8217;s structure.</p>
<p>So was the humor in this case too much, or too vulgar? I&#8217;m sure that Brittany was not the only person in the room who was offended by the talk. On the other hand, as the one &#8220;comic relief&#8221; talk in a 3 day schedule that contained more than its fair share of professionalism, I think it&#8217;s probably fair to say that some members of the audience were relieved to have a chance to laugh about something.</p>
<p>Injecting humor into any talk is dangerous. Especially with a diverse crowd, you are liable to offend somebody. Jokes of a sexual nature are even more dangerous. Even if the joke is not sexist, per se, there is a strong possibility that members of the audience will take offense because of sexual taboos in society. I also imagine the discussion of sex in a strongly gender-imbalanced setting will make members of the minority gender more uncomfortable than the rest of the room.</p>
<p>But neglecting to inject humor is also dangerous. The Mac and iOS communities have a strong tradition of humor in our conferences. Many of us feel annoyed and cheated by a conference if there isn&#8217;t a bit of liveliness. So, it goes both ways. It&#8217;s important to process this incident carefully to understand how it went wrong. Was the problem that there was a session with a noticeably lower level of &#8220;seriousness&#8221; than the other sessions? Was it that the session&#8217;s jokes were of a sexual nature? Or was it that the sexual nature of the talk&#8217;s jokes were not made clear enough to the audience before it took place?</p>
<p>I think what is happening on the web now is many people are seizing onto the angle of Brittany&#8217;s complaint that most resonates with their own frustrations about the conduct of our community. This is a valuable reaction and a good opening for further exploration. But what isn&#8217;t useful is the large number of people who are condemning the conference and the speaker without significant information about the context of what happened. I hope that I have at least helped to clarify that to some extent. If you still feel that blanket condemnation is the appropriate response, then I&#8217;m happier with your opinion now that you&#8217;ve read mine.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2266/how-to-talk-dirty/feed</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>Objective-C Is The Language</title>
		<link>http://www.red-sweater.com/blog/2256/objective-c-is-the-language</link>
		<comments>http://www.red-sweater.com/blog/2256/objective-c-is-the-language#comments</comments>
		<pubDate>Mon, 07 Nov 2011 06:31:52 +0000</pubDate>
		<dc:creator>Daniel Jalkut</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.red-sweater.com/blog/?p=2256</guid>
		<description><![CDATA[My good friend Brent Simmons invokes a historical email from Linus Torvalds, about his disdain for C++ C++ is a horrible language. It&#8217;s made more horrible by the fact that a lot of substandard programmers use it, to the point where it&#8217;s much much easier to generate total and utter crap with it. Brent affirms [...]]]></description>
			<content:encoded><![CDATA[<p>My good friend Brent Simmons invokes a historical email from Linus Torvalds, about his disdain for C++</p>
<blockquote>
<p>C++ is a horrible language. It&#8217;s made more horrible by the fact that a lot of substandard programmers use it, to the point where it&#8217;s much much easier to generate total and utter crap with it.</p>
</blockquote>
<p>Brent <a href="http://inessential.com/2011/11/06/linus_on_c_">affirms his support</a> while paying homage to plain-old C:</p>
<blockquote>
<p>But I will admit to an enduring love of C. I still think of C not as C but as <em>the language</em>.</p>
</blockquote>
<p>I loved C. Emphasis on the past-tense. As object-oriented programming concepts became popular, those of us who were programming in C or similar procedural languages had to find new, object-oriented languages to fulfill our needs. At the time, I chose C++. Or I should say, I had C++ forced upon me. Because C++ popularized the notion of object-oriented programming, it was the only choice presented to many programmers.</p>
<p>Because I ended up at Apple, the time I spent with C++ was thankfully short. They were fortuitously behind the times at the dawn of my career, and wound up taking a different path while my career was ascending.</p>
<p>Objective-C was Apple&#8217;s response to object-oriented programming, and continues to be the lingua-franca for programmers on Macs, iPhones and iPads. I loved C. I love C. But it always fell short for me. It lacked something. Objective-C fixed that. I hope I never have to program in C++ again. But tellingly, I also hope I never have to program in C again.</p>
<p>There are lots of great features from Python, Ruby, or JavaScript, that I&#8217;d love to see incorporated into Objective-C. By no means is it perfect. But for its elegance, and for the fact that it fulfills many of the requirements of object-oriented programming, while maintaining the familiar simplicity of C, it presently earns the title of <em>the language</em> for me.</p>
<p>[<strong>Update Nov 7</strong>: I've had a lot of reaction to my claim above that Objective-C was "Apple's response to object-oriented programming." This makes it sound like Apple invented the language, and they didn't. But they have done more to popularize and promote it than anybody else. I stand by the meaning of it being "what they bring to the table," when it comes to object-oriented programming].</p>
]]></content:encoded>
			<wfw:commentRss>http://www.red-sweater.com/blog/2256/objective-c-is-the-language/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
	</channel>
</rss>

