<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Code Kills</title>
    <link>http://blog.codekills.net</link>
    <description></description>
    <pubDate>Mon, 09 Apr 2012 04:04:13 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Adventures in X.509: The Utterly Ignored nameConstraints</title>
      <link>http://blog.codekills.net/2012/04/08/adventures-in-x509-the-utterly-ignored-nameconstraints</link>
      <pubDate>Sun, 08 Apr 2012 21:16:08 EDT</pubDate>
      <category>OpenSSL</category>
      <category>MintChip</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/04/08/adventures-in-x509-the-utterly-ignored-nameconstraints</guid>
      <description>Adventures in X.509: The Utterly Ignored nameConstraints</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;In &lt;a class=&#34;reference external&#34; href=&#34;http://blog.codekills.net/2012/04/07/a-first-look-at-mintchip&#39;s-hosted-api&#39;s-crypto/&#34;&gt;yesterday&#39;s post looking at MintChip&#39;s hosted API&#39;s crypto&lt;/a&gt;, I noticed
that MintChip&#39;s certificate authority does not have any &lt;a class=&#34;reference external&#34; href=&#34;http://tools.ietf.org/html/rfc5280#section-4.2.1.10&#34;&gt;name constraints&lt;/a&gt;.
This was surprising, because this seemed like a simple and obvious issue with
an otherwise well designed system... But after some experimentation, it seems
that OpenSSL simply ignores &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt;, so they would be mostly
worthless even if they were used.&lt;/p&gt;
&lt;div class=&#34;section&#34; id=&#34;adding-nameconstraints-to-mintchip-s-ca&#34;&gt;
&lt;h1&gt;Adding nameConstraints to MintChip&#39;s CA&lt;/h1&gt;
&lt;p&gt;This can be seen by adding some &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt; to MintChip&#39;s certificate
authority and re-signing it using a new, trusted, certificate authority.&lt;/p&gt;
&lt;p&gt;Note that all files referenced here can be found at
&lt;a class=&#34;reference external&#34; href=&#34;/uploads/adventures_in_x509_ignored_nameconstraints/&#34;&gt;/uploads/adventures_in_x509_ignored_nameconstraints/&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A new certificate authority is created and the &lt;tt class=&#34;docutils literal&#34;&gt;add_name_constraints.py&lt;/tt&gt; to
add &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt; to MintChip&#39;s CA&#39;s certiificate, creating
&lt;tt class=&#34;docutils literal&#34;&gt;mintchip_with_constraints.crt&lt;/tt&gt;, which will be signed by the new CA:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ openssl req -new -x509 -keyout trusted_ca.pem -out trusted_ca.pem -nodes
...
Organizational Unit Name (eg, section) []: New Trusted Authority
...
$ ./add_name_constraints.py trusted_ca.pem mintchip_ca.crt &amp;gt; mintchip_with_constraints.crt
$ openssl x509 -noout -text -in mintchip_with_constraints.crt
Data:
    ...
    Issuer: OU=New Trusted Authority
    Subject: CN=Remote MintChip Certificate Authority, OU=Remote MintChip, O=Royal Canadian Mint, C=CA
    ...
    X509v3 extensions:
        ...
        X509v3 Name Constraints: critical
            Permitted:
              DNS:does_not_exist.com
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;testing-the-constraints&#34;&gt;
&lt;h1&gt;Testing the Constraints&lt;/h1&gt;
&lt;p&gt;The constraints can now be tested using OpenSSL&#39;s &lt;tt class=&#34;docutils literal&#34;&gt;s_client&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ cat trusted_ca.pem mintchip_with_constraints.crt &amp;gt; ca_list.crt
$ openssl s_client -CAfile ca_list.crt -connect remote.mintchipchallenge.com:443
CONNECTED(00000003)
depth=2 /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/OU=New Trusted Authority
verify return:1
depth=1 /CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
verify return:1
depth=0 /CN=remote.mintchipchallenge.com/OU=Remote MintChip Server/O=Royal Canadian Mint/C=CA
verify return:1
...
SSL-Session:
    ...
    Verify return code: 0 (ok)
---
&lt;/pre&gt;
&lt;p&gt;Note that:&lt;/p&gt;
&lt;ol class=&#34;arabic simple&#34;&gt;
&lt;li&gt;Our &amp;quot;New Trusted Authority&amp;quot; is used to verify MintChip&#39;s Certificate
Authority (first six lines).&lt;/li&gt;
&lt;li&gt;The SSL session is successfully verified (the last line).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This suggests that OpenSSL is not checking name constraints.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;double-checking&#34;&gt;
&lt;h1&gt;Double Checking&lt;/h1&gt;
&lt;p&gt;To double check that our certificat authority is actually being consulted, the
same test can be run, except using only the &lt;tt class=&#34;docutils literal&#34;&gt;mintchip_with_constraints.crt&lt;/tt&gt;
certificate:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ openssl s_client -CAfile mintchip_with_constraints.crt \
    -connect remote.mintchipchallenge.com:443
CONNECTED(00000003)
depth=1 /CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
verify error:num=2:unable to get issuer certificate
issuer= /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/OU=New Trusted Authority
verify return:0
...
SSL-Session:
    ...
    Verify return code: 2 (unable to get issuer certificate)
---
&lt;/pre&gt;
&lt;p&gt;The verify now fails, so it&#39;s fairly certain that the certificate chain is
working as expected.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;adding-dirname-nameconstraints&#34;&gt;
&lt;h1&gt;Adding dirName nameConstraints&lt;/h1&gt;
&lt;blockquote&gt;
Applications conforming to this profile MUST be able to process name
constraints that are imposed on the directoryName name form and
SHOULD be able to process name constraints that are imposed on the
rfc822Name, uniformResourceIdentifier, dNSName, and iPAddress name
forms.&lt;/blockquote&gt;
&lt;p&gt;On closer inspection of &lt;a class=&#34;reference external&#34; href=&#34;http://tools.ietf.org/html/rfc5280#section-4.2.1.10&#34;&gt;RFC 5280&lt;/a&gt;, it turns out that applications are only
required to check name constraints which are imposed on directory names.&lt;/p&gt;
&lt;p&gt;This poses a slight challenge, as (for various reasons) pyOpenSSL cannot create
a &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt; extension which imposes a &lt;tt class=&#34;docutils literal&#34;&gt;dirName&lt;/tt&gt; constraint[0].&lt;/p&gt;
&lt;p&gt;The OpenSSL command line tools can be used to create a new certificate which
&lt;em&gt;does&lt;/em&gt; contain &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt; on a &lt;tt class=&#34;docutils literal&#34;&gt;dirName&lt;/tt&gt; (see the definition in
&lt;a class=&#34;reference external&#34; href=&#34;/uploads/adventures_in_x509_ignored_nameconstraints/name_constraints_on_dirNames.cfg&#34;&gt;name_constraints_on_dirNames.cfg&lt;/a&gt;), then pyOpenSSL can load that
certificate and copy the constraints into the target:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ openssl req -new -x509 -nodes -config name_constraints_on_dirNames.cfg \
&amp;gt;   -out dirName_constraints.crt
...
$ ./add_name_constraints.py trusted_ca.pem mintchip_ca.crt \
&amp;gt;   dirName_constraint.crt &amp;gt; mintchip_with_dirName_constraints.crt
...
$ openssl x509 -noout -text -in mintchip_with_dirName_constraints.crt
Certificate:
    ...
    X509v3 extensions:
        ...
        X509v3 Name Constraints: critical
            Permitted:
              DirName: CN = bad_common_name
&lt;/pre&gt;
&lt;p&gt;Nifty!&lt;/p&gt;
&lt;p&gt;[0]: OpenSSL expects the value of the &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;dirName=...&lt;/span&gt;&lt;/tt&gt; to be a name which is
looked up in the configuration database (ex, &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints =
permitted;dirName=some_section_&lt;/tt&gt;), but pyOpenSSL does not &lt;a class=&#34;reference external&#34; href=&#34;http://bazaar.launchpad.net/~exarkun/pyopenssl/trunk/view/156.3.5/OpenSSL/crypto/x509ext.c#L115&#34;&gt;provide a
configuration database&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;testing-the-dirname-constraint&#34;&gt;
&lt;h1&gt;Testing the dirName Constraint&lt;/h1&gt;
&lt;p&gt;Testing this new certificate with &lt;tt class=&#34;docutils literal&#34;&gt;s_client&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ cat trusted_ca.pem mintchip_with_dirName_constraints.crt \
&amp;gt;   &amp;gt; ca_list_with_dirName_constraints.crt
$ openssl s_client -CAfile ca_list_with_dirName_constraints.crt \
&amp;gt;   -connect remote.mintchipchallenge.com:443
CONNECTED(00000003)
depth=2 /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/OU=New Trusted Authority
verify return:1
depth=1 /CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
verify return:1
depth=0 /CN=remote.mintchipchallenge.com/OU=Remote MintChip Server/O=Royal Canadian Mint/C=CA
verify return:1
...
SSL-Session:
    ...
    Verify return code: 0 (ok)
---
&lt;/pre&gt;
&lt;p&gt;Still no love. It sure looks like OpenSSL simply ignores the
&lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt; field on certificate authorities.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;post-script&#34;&gt;
&lt;h1&gt;Post Script&lt;/h1&gt;
&lt;p&gt;On Twitter, &lt;a class=&#34;reference external&#34; href=&#34;https://twitter.com/#!/dakami&#34;&gt;Dan Kaminsky&lt;/a&gt; was kind enough to &amp;quot;confirm&amp;quot; my suspicions:&lt;/p&gt;
&lt;blockquote class=&#34;twitter-tweet&#34; data-in-reply-to=&#34;189102630683938816&#34;&gt;&lt;p style=&#39;margin-top: 0; padding-top: 0;&#39;&gt;@&lt;a href=&#34;https://twitter.com/wolever&#34;&gt;wolever&lt;/a&gt; @&lt;a href=&#34;https://twitter.com/hypatiadotca&#34;&gt;hypatiadotca&lt;/a&gt; You can&#39;t rely on name constraints.There&#39;s a reason nobody will ever sell you a name constrained cert.&lt;/p&gt;&amp;mdash; Dan Kaminsky (@dakami) &lt;a href=&#34;https://twitter.com/dakami/status/189103399575363585&#34; data-datetime=&#34;2012-04-08T21:32:18+00:00&#34;&gt;April 8, 2012&lt;/a&gt;&lt;/blockquote&gt;&lt;p&gt;And suggests:&lt;/p&gt;
&lt;blockquote class=&#34;twitter-tweet&#34; data-in-reply-to=&#34;189102630683938816&#34;&gt;&lt;p style=&#39;margin-top: 0; padding-top: 0&#39;&gt;@&lt;a href=&#34;https://twitter.com/wolever&#34;&gt;wolever&lt;/a&gt; @&lt;a href=&#34;https://twitter.com/hypatiadotca&#34;&gt;hypatiadotca&lt;/a&gt; They might be checked by CryptoAPI and NSS, but it doesn&#39;t matter.&lt;/p&gt;&amp;mdash; Dan Kaminsky (@dakami) &lt;a href=&#34;https://twitter.com/dakami/status/189103525408681987&#34; data-datetime=&#34;2012-04-08T21:32:48+00:00&#34;&gt;April 8, 2012&lt;/a&gt;&lt;/blockquote&gt;&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;tl-dr&#34;&gt;
&lt;h1&gt;tl;dr&lt;/h1&gt;
&lt;p&gt;OpenSSL does not check &lt;tt class=&#34;docutils literal&#34;&gt;nameConstraints&lt;/tt&gt;. Yay.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>A First Look at MintChip&#39;s Hosted API&#39;s Crypto</title>
      <link>http://blog.codekills.net/2012/04/07/a-first-look-at-mintchip's-hosted-api's-crypto</link>
      <pubDate>Sat, 07 Apr 2012 20:05:49 EDT</pubDate>
      <category>OpenSSL</category>
      <category>MintChip</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/04/07/a-first-look-at-mintchip's-hosted-api's-crypto</guid>
      <description>A First Look at MintChip&#39;s Hosted API&#39;s Crypto</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;The &lt;a class=&#34;reference external&#34; href=&#34;http://en.wikipedia.org/wiki/Royal_Canadian_Mint&#34;&gt;Royal Canadian Mint&lt;/a&gt; announced a challenge last week, calling for
developers to build software which uses MintChip. MintChip is a proposed
digital currency which is decentralized, anonymous, and offline. The (currently
scarce) details of the device and developer challenge can be found at
&lt;a class=&#34;reference external&#34; href=&#34;http://mintchipchallenge.com/&#34;&gt;mintchipchallenge.com&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;A couple of friends and I have signed up to build something, and we just got
the private keys and certificates necessary to interact with the &amp;quot;hosted
MintChip&amp;quot; API.&lt;/p&gt;
&lt;div class=&#34;section&#34; id=&#34;overview&#34;&gt;
&lt;h1&gt;Overview&lt;/h1&gt;
&lt;p&gt;Before I go into more detail, let me first explain: payments are processed by
the &amp;quot;trusted&amp;quot;[0] MintChip hardware. This hardware can either be attached
directly to the device facilitating a payment (for example, a smart phone), or
hosted by a trusted 3rd party, allowing the MintChip to be used from any
internet-connected device.&lt;/p&gt;
&lt;p&gt;This is called the &amp;quot;hosted API&amp;quot;, and this post deals with the cryptography used
for authentication and privacy by the current implementation of the hosted API.&lt;/p&gt;
&lt;p&gt;Once my physical devices arrive, I will write a post about them, provided they
are sufficiently interesting.&lt;/p&gt;
&lt;p&gt;[0]: at least, trusted in theory; if the hardware is compromised it would be
possible to forge transactions (ex, double-spend, create new money, etc).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;the-hosted-api&#34;&gt;
&lt;h1&gt;The Hosted API&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important notes&lt;/strong&gt;:&lt;/p&gt;
&lt;ul class=&#34;simple&#34;&gt;
&lt;li&gt;Everything here is &lt;em&gt;educated guesswork&lt;/em&gt;, based only on the sparse
MintChip documentation and the PKCS12 file which is used to access
the hosted API.&lt;/li&gt;
&lt;li&gt;I am an x509 enthusiast but &lt;em&gt;not&lt;/em&gt; an expert. If you are, I would very
much appreciate it if you pointed out any inaccuracies or omissions.&lt;/li&gt;
&lt;li&gt;This is a &lt;em&gt;developer preview&lt;/em&gt; of a &lt;em&gt;proof-of-concept&lt;/em&gt;.  There is no
guarantee that the security of the final system will look
&lt;em&gt;anything at all&lt;/em&gt; like the system I&#39;m describing here.&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt;
&lt;p&gt;The first thing you&#39;ll notice when trying to access the hosted HTTPS API is
that it signed with an &amp;quot;invalid&amp;quot; certificate (although this is for a sensible
reason; keep reading):&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ curl https://remote.mintchipchallenge.com
curl: (60) SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
More details here: http://curl.haxx.se/docs/sslcerts.html
&lt;/pre&gt;
&lt;p&gt;And connecting anyway yields a 403 Forbidden (also, that they are running
ASP.NET):&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ curl -Ik https://remote.mintchipchallenge.com
HTTP/1.1 403 Forbidden
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
&lt;/pre&gt;
&lt;div class=&#34;section&#34; id=&#34;https-server-certificate&#34;&gt;
&lt;h2&gt;HTTPS Server Certificate&lt;/h2&gt;
&lt;p&gt;Grabbing and dumping the certificate they are using:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ openssl s_client -connect remote.mintchipchallenge.com:443 -showcerts \
&amp;gt; | openssl x509 -noout -text
...
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 2 (0x2)
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: CN=Remote MintChip Certificate Authority, OU=Remote MintChip, O=Royal Canadian Mint, C=CA
        Validity
            Not Before: Mar  6 08:25:42 2012 GMT
            Not After : Mar  7 08:25:42 2013 GMT
        Subject: CN=remote.mintchipchallenge.com, OU=Remote MintChip Server, O=Royal Canadian Mint, C=CA
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (1024 bit)
                Modulus (1024 bit):
                    00:8e:1c:52:2f:c7:62:7d:05:0b:4a:80:4f:cb:91:
                    ...
                    5a:90:60:58:f9:43:c8:bc:f1
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Key Encipherment, Key Agreement
            X509v3 Extended Key Usage:
                TLS Web Server Authentication
    Signature Algorithm: sha1WithRSAEncryption
        58:34:a3:bd:f3:8d:17:b2:eb:4e:ed:f6:58:b0:13:3b:8c:79:
        ...
        91:0d:59:81
...
&lt;/pre&gt;
&lt;p&gt;Note that the certificate is issued by &amp;quot;Remote MintChip Authority&amp;quot;. I suspect
that MintChip chose to use their own CA both for simplicity (they don&#39;t need to
deal with a 3rd party) and &lt;a class=&#34;reference external&#34; href=&#34;http://blogs.comodo.com/it-security/data-security/the-recent-ra-compromise/&#34;&gt;security&lt;/a&gt;. Apart from that, this certificate looks
&lt;em&gt;fairly&lt;/em&gt; standard (although I don&#39;t fully understand the implications of the
&amp;quot;Key Agreement&amp;quot; flag).&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;developer-account-pkcs12-files&#34;&gt;
&lt;h2&gt;Developer Account PKCS12 Files&lt;/h2&gt;
&lt;p&gt;Next, once my developer account[0] was approved, I was sent two PKCS12 files
(and the passwords used to decrypt them), corresponding to (I assume) two
hosted MintChips.&lt;/p&gt;
&lt;p&gt;[0]: actually, my friend&#39;s developer account - mine hasn&#39;t been approved yet.&lt;/p&gt;
&lt;p&gt;Unpacking each of these PKCS12 files yields one private key and two
certificates:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ openssl pkcs12 -nodes -passin pass:hunter2 -info -in 1310000000008139.p12
MAC Iteration 1024
MAC verified OK
PKCS7 Data
Shrouded Keybag: pbeWithSHA1And3-KeyTripleDES-CBC, Iteration 1024
Bag Attributes
    localKeyID: 82 8F 5D AD 42 DC C9 EA 25 2C 6E 65 C0 DB B8 20 52 7D 1D 15
    friendlyName: 1310000000008139 Remote MintChip Client (Developer Challenge)
Key Attributes: &amp;lt;No Attributes&amp;gt;
-----BEGIN RSA PRIVATE KEY-----
...
-----END RSA PRIVATE KEY-----
PKCS7 Encrypted data: pbeWithSHA1And40BitRC2-CBC, Iteration 1024
Certificate bag
Bag Attributes
    localKeyID: 82 8F 5D AD 42 DC C9 EA 25 2C 6E 65 C0 DB B8 20 52 7D 1D 15
    friendlyName: 1310000000008139 Remote MintChip Client (Developer Challenge)
subject=/CN=1310000000008139/OU=Remote MintChip Client/O=Royal Canadian Mint/C=CA
issuer=/CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
Certificate bag
Bag Attributes
    friendlyName: Remote MintChip CA (Developer Challenge)
subject=/CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
issuer=/CN=Remote MintChip Certificate Authority/OU=Remote MintChip/O=Royal Canadian Mint/C=CA
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;the-private-key&#34;&gt;
&lt;h2&gt;The Private Key&lt;/h2&gt;
&lt;p&gt;As far as I can tell there is nothing noteworthy about the private key.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;the-client-authentication-certificate&#34;&gt;
&lt;h2&gt;The Client Authentication Certificate&lt;/h2&gt;
&lt;p&gt;Inspecting the first of the two certificates yields:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ echo &amp;quot;$FIRST_CERT&amp;quot; | openssl x509 -noout -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 1198 (0x4ae)
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: CN=Remote MintChip Certificate Authority, OU=Remote MintChip, O=Royal Canadian Mint, C=CA
        Validity
            Not Before: Mar  6 10:06:45 2012 GMT
            Not After : Mar  7 10:06:45 2013 GMT
        Subject: CN=1310000000008139, OU=Remote MintChip Client, O=Royal Canadian Mint, C=CA
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (1024 bit)
                Modulus (1024 bit):
                    00:a7:1b:d9:81:17:ce:ae:b7:e8:46:6c:51:6b:b8:
                    ...
                    62:20:0b:93:f7:02:4c:c5:dd
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:FALSE
            X509v3 Key Usage:
                Digital Signature
            X509v3 Extended Key Usage:
                TLS Web Client Authentication
    Signature Algorithm: sha1WithRSAEncryption
        67:b9:d1:47:c2:62:82:60:1d:f9:01:04:de:c6:db:19:f3:3e:
        ...
        17:16:60:0f
&lt;/pre&gt;
&lt;p&gt;As can be seen by the &amp;quot;Extended Key Usage&amp;quot; extension, this certificate will be
used for &lt;a class=&#34;reference external&#34; href=&#34;http://pilif.github.com/2008/05/why-is-nobody-using-ssl-client-certificates/&#34;&gt;client-side certificate authentication&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I think this is pretty cool. When password protected, client-side certificates
provide a nifty and unobtrusive form of two-factor authentication.  I&#39;ve only
ever seen them used &amp;quot;in the wild&amp;quot; by &lt;a class=&#34;reference external&#34; href=&#34;http://www.cacert.org/&#34;&gt;CACert&lt;/a&gt;, so it&#39;s fun to see someone
else using them.&lt;/p&gt;
&lt;p&gt;As before, this certificate is signed by the &amp;quot;Remote MintChip Certificate
Authority&amp;quot;.&lt;/p&gt;
&lt;p&gt;Nothing else is particularly surprising.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;the-certificate-authority-s-certificate&#34;&gt;
&lt;h2&gt;The Certificate Authority&#39;s Certificate&lt;/h2&gt;
&lt;p&gt;Now, on to the second certificate:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ echo &amp;quot;$SECOND_CERT&amp;quot; | openssl x509 -noout -text
Certificate:
    Data:
        Version: 3 (0x2)
        Serial Number: 1 (0x1)
        Signature Algorithm: sha1WithRSAEncryption
        Issuer: CN=Remote MintChip Certificate Authority, OU=Remote MintChip, O=Royal Canadian Mint, C=CA
        Validity
            Not Before: Mar  6 08:25:36 2012 GMT
            Not After : Mar  7 08:25:36 2017 GMT
        Subject: CN=Remote MintChip Certificate Authority, OU=Remote MintChip, O=Royal Canadian Mint, C=CA
        Subject Public Key Info:
            Public Key Algorithm: rsaEncryption
            RSA Public Key: (2048 bit)
                Modulus (2048 bit):
                    00:ab:d9:7b:dc:a8:eb:55:59:05:46:23:ef:4d:76:
                    ...
                    9a:c1
                Exponent: 65537 (0x10001)
        X509v3 extensions:
            X509v3 Basic Constraints:
                CA:TRUE
            X509v3 Key Usage:
                Certificate Sign
            X509v3 Extended Key Usage:
                TLS Web Client Authentication, TLS Web Server Authentication
    Signature Algorithm: sha1WithRSAEncryption
        41:95:6f:94:9a:3e:9d:03:af:a3:22:d6:0f:b6:7a:08:91:9d:
        ...
        b3:da:88:bf
&lt;/pre&gt;
&lt;p&gt;This is the certificate of the &amp;quot;Remote MintChip Certificate Authority&amp;quot; that has
signed all the other certificates we&#39;ve looked at.&lt;/p&gt;
&lt;p&gt;Unlike all the other certificates we&#39;ve looked at, though, this certificate
&lt;em&gt;is&lt;/em&gt; surprising: this certificate needs to be[0] added to the list of trusted
CAs on all the devices which will use the MintChip hosted API... But it
&lt;em&gt;doesn&#39;t include any name constraints!&lt;/em&gt; [1] This means that, if the CA&#39;s private
key was compromised, it could be used to forge certificates that would be
trusted by any device which trusts this CA.&lt;/p&gt;
&lt;p&gt;I find this omission a bit surprising; the hosted API&#39;s security appears to be
well designed, which makes it seem unlikely that this was accidental.&lt;/p&gt;
&lt;p&gt;Because the system is otherwise intelligent, I&#39;m inclined to give MintChip the
benefit of the doubt here, and assume that there is a good reason for omitting
the name constraints. This is a developer-only preview of a proof-of-concept
system, so it&#39;s possible they will be changing domains or using this CA in
as-of-yet unexpected ways.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit&lt;/strong&gt;: after some experimentaton, it seems that there is a less mysterious
reason for the CA&#39;s lack of name constraints: they are ignored. For more
details, see &amp;quot;&lt;a class=&#34;reference external&#34; href=&#34;/2012/04/08/adventures-in-x509-the-utterly-ignored-nameconstraints/&#34;&gt;Adventures in X.509: The Utterly Ignored nameConstraints&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;div class=&#34;line-block&#34;&gt;
&lt;div class=&#34;line&#34;&gt;[0]: or, at least, &amp;quot;really should be&amp;quot;&lt;/div&gt;
&lt;div class=&#34;line&#34;&gt;[1]: &lt;a class=&#34;reference external&#34; href=&#34;http://www.faqs.org/rfcs/rfc2459.html&#34;&gt;RFC 2459&lt;/a&gt; section 4.2.1.11, &amp;quot;Name Constraints&amp;quot;.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;tl-dr&#34;&gt;
&lt;h1&gt;tl;dr&lt;/h1&gt;
&lt;p&gt;The MintChip hosted API uses SSL client certificates for authentication, and
both client and server certificates are signed by MintChip&#39;s own self-signed
certificate authority.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>In MySQL land, &#34;latin1&#34; isn&#39;t actually latin1</title>
      <link>http://blog.codekills.net/2012/03/20/in-mysql-latin1-isnt-actually-latin1</link>
      <pubDate>Tue, 20 Mar 2012 02:41:56 EDT</pubDate>
      <category>Unicode</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/03/20/in-mysql-latin1-isnt-actually-latin1</guid>
      <description>In MySQL land, &#34;latin1&#34; isn&#39;t actually latin1</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;Lesson learned: in MySQL land, &amp;quot;latin1&amp;quot; isn&#39;t actually latin1 — it&#39;s
cp1252[0].&lt;/p&gt;
&lt;p&gt;The the consequence? Magic. Everything will appear to work until a connection
character encoding is specified, a &lt;tt class=&#34;docutils literal&#34;&gt;SELECT INTO OUTFILE&lt;/tt&gt; is issued, or you
start to realize that unicode data are taking up two or three times more disk
space than they reasonably should.&lt;/p&gt;
&lt;p&gt;More specifically: when no connection character set is specified, MySQL
defaults to using &amp;quot;latin1&amp;quot;. Additionally, programmers will occasionally send
utf8 encoded data over a MySQL connection without setting the connections&#39;
character set… Which leads to unexpected results under the conditions described
above.&lt;/p&gt;
&lt;p&gt;For example, imagine that the string &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;u&amp;quot;☃&amp;quot;&lt;/span&gt;&lt;/tt&gt; is encoded as utf8
(&lt;tt class=&#34;docutils literal&#34;&gt;&amp;quot;\xe2\x98\x83&amp;quot;&lt;/tt&gt;) and  sent to MySQL over a connection using the cp1252
character set (the default if no &lt;tt class=&#34;docutils literal&#34;&gt;SET CHARACTER SET&lt;/tt&gt; command is issued).
MySQL will receive these three bytes, then decoded them as cp1252, yielding
&lt;em&gt;three&lt;/em&gt; unicode code points: &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;u&amp;quot;\xe2\u02dc\u0192&amp;quot;&lt;/span&gt;&lt;/tt&gt;. These three code points
are then stored to disk using the &lt;em&gt;column&#39;s&lt;/em&gt; character set (for example, if the
column&#39;s character set is utf8, the bytes &lt;tt class=&#34;docutils literal&#34;&gt;&amp;quot;\xc3\xa2\xcb\x9c\xc6\x92&amp;quot;&lt;/tt&gt; will
be written to disk):&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
&amp;gt;&amp;gt;&amp;gt; u&amp;quot;☃&amp;quot;
u&#39;\u2603&#39;
&amp;gt;&amp;gt;&amp;gt; _.encode(&amp;quot;utf8&amp;quot;)
&amp;quot;\xe2\x98\x83&amp;quot;
&amp;gt;&amp;gt;&amp;gt; _.decode(&amp;quot;cp1252&amp;quot;)
u&amp;quot;\xe2\u02dc\u0192&amp;quot;
&amp;gt;&amp;gt;&amp;gt; _.encode(&amp;quot;utf8&amp;quot;)
&amp;quot;\xc3\xa2\xcb\x9c\xc6\x92&amp;quot;
&lt;/pre&gt;
&lt;p&gt;Next, when that string is sent back to a client, the bytes are read from disk
and decoded using the column&#39;s character set: &lt;tt class=&#34;docutils literal&#34;&gt;&amp;quot;\xc3\xa2\xcb\x9c\xc6\x92&amp;quot;&lt;/tt&gt;
decodes to &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;u&amp;quot;\xe2\u02dc\u0192&amp;quot;&lt;/span&gt;&lt;/tt&gt;. This string is then encoded using the
connections character set and the resulting bytes are sent back to the client:
&lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;u&amp;quot;\xe2\u02dc\u0192&amp;quot;&lt;/span&gt;&lt;/tt&gt; encodes to &lt;tt class=&#34;docutils literal&#34;&gt;&amp;quot;\xe2\x98\x83&amp;quot;&lt;/tt&gt; — the &amp;quot;correct&amp;quot; utf8
bytes:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
&amp;gt;&amp;gt;&amp;gt; &amp;quot;\xc3\xa2\xcb\x9c\xc6\x92&amp;quot;.decode(&amp;quot;utf8&amp;quot;)
u&amp;quot;\xe2\u02dc\u0192&amp;quot;
&amp;gt;&amp;gt;&amp;gt; _.encode(&amp;quot;cp1252&amp;quot;)
&amp;quot;\xe2\x98\x83&amp;quot;
&amp;gt;&amp;gt;&amp;gt; _.decode(&amp;quot;utf8&amp;quot;)
u&#39;\u2603&#39;
&amp;gt;&amp;gt;&amp;gt; print _
☃
&lt;/pre&gt;
&lt;p&gt;And the client will continue to see the &amp;quot;correct&amp;quot; utf8 bytes until the last
&amp;quot;encode as cp1252&amp;quot; step is omitted… For example, because the connection&#39;s
character set has changed, or because the &lt;tt class=&#34;docutils literal&#34;&gt;SELECT INTO OUTFILE&lt;/tt&gt; command is
issued[1].&lt;/p&gt;
&lt;p&gt;In cases when the last &amp;quot;encode as cp1252&amp;quot; step is omitted, results will seem
&lt;em&gt;very&lt;/em&gt; strange. For example, if the &lt;tt class=&#34;docutils literal&#34;&gt;SET CHARACTER SET binary&lt;/tt&gt; command is
issued (to simulate a &lt;tt class=&#34;docutils literal&#34;&gt;SELECT INTO OUTFILE&lt;/tt&gt;), the bytes
&lt;tt class=&#34;docutils literal&#34;&gt;&amp;quot;\xc3\xa2\xcb\x9c\xc6\x92&amp;quot;&lt;/tt&gt; will be returned, and similar things will happen
if the connection encoding is set to utf8.&lt;/p&gt;
&lt;p&gt;Note also that six bytes are being used to store a three utf8 bytes.&lt;/p&gt;
&lt;p&gt;With the luxury of planning and foresight, this madness could have been avoided
by:&lt;/p&gt;
&lt;ul class=&#34;simple&#34;&gt;
&lt;li&gt;Issuing &lt;tt class=&#34;docutils literal&#34;&gt;SET CHARACTER SET utf8&lt;/tt&gt; at the start of connections.&lt;/li&gt;
&lt;li&gt;Ensuring that (unless there is a good reason not to), databases have
&lt;tt class=&#34;docutils literal&#34;&gt;DEFAULT CHARACTER SET utf8&lt;/tt&gt;.&lt;/li&gt;
&lt;li&gt;Ensuring that only utf8 bytes are sent to the database.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;But, as is so often the case, the particular data which lead to this discovery
were generated by a PHP application that is out of my control... So for now, I
will be living with &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;.decode(&amp;quot;utf8&amp;quot;).encode(&amp;quot;cp1252&amp;quot;).decode(&amp;quot;utf8&amp;quot;)&lt;/span&gt;&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;(thanks to &lt;a class=&#34;reference external&#34; href=&#34;http://twitter.com/jaaaarel&#34;&gt;Taavi Burns&lt;/a&gt;, who &lt;a class=&#34;reference external&#34; href=&#34;http://stackoverflow.com/a/9776944/71522&#34;&gt;pointed out&lt;/a&gt; that MySQL assumes &amp;quot;latin1&amp;quot;
means &amp;quot;cp1252&amp;quot;, making it possible to solve &lt;a class=&#34;reference external&#34; href=&#34;http://stackoverflow.com/q/9764898/71522&#34;&gt;my original problem&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;[0]: as documented here:
&lt;a class=&#34;reference external&#34; href=&#34;http://dev.mysql.com/doc/refman/5.0/en/charset-we-sets.html&#34;&gt;http://dev.mysql.com/doc/refman/5.0/en/charset-we-sets.html&lt;/a&gt; (fun fact: the at
the top of the Wikipedia entry for &lt;a class=&#34;reference external&#34; href=&#34;http://en.wikipedia.org/wiki/ISO/IEC_8859-1&#34;&gt;8859-1&lt;/a&gt; (latin1), there is the notice:
“For the character encoding commonly mislabeled as &amp;quot;ISO-8859-1&amp;quot;, see
Windows-1252”).&lt;/p&gt;
&lt;p&gt;[1]: &lt;tt class=&#34;docutils literal&#34;&gt;SELECT INTO OUTFILE&lt;/tt&gt; uses the column&#39;s encoding, not the connection&#39;s: &lt;a class=&#34;reference external&#34; href=&#34;http://dev.mysql.com/doc/refman/5.0/en/select-into.html&#34;&gt;http://dev.mysql.com/doc/refman/5.0/en/select-into.html&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Vim functions to change tab treatment</title>
      <link>http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment</link>
      <pubDate>Sun, 22 Jan 2012 16:00:00 EST</pubDate>
      <category>Vim</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment</guid>
      <description>Vim functions to change tab treatment</description>
      <content:encoded>

&lt;p&gt;I&#39;ve gotten tired of doing the &lt;tt&gt;:setlocal tabstop=...&lt;/tt&gt; dance every
time I start editing a file from someone who has their own unique feelings
about how wide tabs should be... So I&#39;ve written two little functions which
make it easy to change a buffer&#39;s tab mode:&lt;/p&gt;

&lt;script src=&#34;https://gist.github.com/1658762.js?file=tabtreatment.vim&#34;&gt;&lt;/script&gt;

&lt;p&gt;For example, when I start editing something written by someone who believes
spaces are evil and tabs should be five spaces wide, I just need to &lt;tt&gt;:call
HardTabs(5)&lt;/tt&gt;.&lt;/p&gt;
</content:encoded>
    </item>
    <item>
      <title>In case of Wikimergency (removing Wikipedia&#39;s blackout)</title>
      <link>http://blog.codekills.net/2012/01/18/in-case-of-wikimergency</link>
      <pubDate>Wed, 18 Jan 2012 02:06:12 EST</pubDate>
      <category>Uncategorized</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/18/in-case-of-wikimergency</guid>
      <description>In case of Wikimergency (removing Wikipedia&#39;s blackout)</description>
      <content:encoded>

&lt;p&gt;Here&#39;s a bookmarklet that will remove the &lt;a href=&#34;http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more&#34;&gt;SOPA&lt;/a&gt; blackout overlay from
Wikipedia:&lt;/p&gt;

&lt;code&gt;
javascript:(function(){document.getElementById(&#34;mw-sopaOverlay&#34;).style.display = &#34;none&#34;; var ids = [&#34;mw-page-base&#34;, &#34;mw-head-base&#34;, &#34;content&#34;, &#34;mw-head&#34;, &#34;mw-panel&#34;, &#34;footer&#34;]; for (var i = 0; i &lt; ids.length; i += 1) document.getElementById(ids[i]).style.display = &#34;block&#34;;})()
&lt;/code&gt;

&lt;p&gt;Or &lt;a href=&#34;javascript:(function(){document.getElementById(&amp;qt;mw-sopaOverlay&amp;qt;).style.display = &amp;qt;none&amp;qt;; var ids = [&amp;qt;mw-page-base&amp;qt;, &amp;qt;mw-head-base&amp;qt;, &amp;qt;content&amp;qt;, &amp;qt;mw-head&amp;qt;, &amp;qt;mw-panel&amp;qt;, &amp;qt;footer&amp;qt;]; for (var i = 0; i &lt; ids.length; i += 1) document.getElementById(ids[i]).style.display = &amp;qt;block&amp;qt;;})()&#34;&gt;bookmark this link&lt;/a&gt;.&lt;/p&gt;


</content:encoded>
    </item>
    <item>
      <title>Loading Google Closure libraries from Node.js</title>
      <link>http://blog.codekills.net/2012/01/10/loading-google-closure-libraries-from-node.js</link>
      <pubDate>Tue, 10 Jan 2012 01:24:42 EST</pubDate>
      <category>JavaScript</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/10/loading-google-closure-libraries-from-node.js</guid>
      <description>Loading Google Closure libraries from Node.js</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;While developing &lt;a class=&#34;reference external&#34; href=&#34;http://wolever.github.com/remora/example/&#34;&gt;remora&lt;/a&gt; (which will be released &amp;quot;soon&amp;quot;) I had to load
&lt;a class=&#34;reference external&#34; href=&#34;http://code.google.com/closure/&#34;&gt;Google Closure&lt;/a&gt; libraries from &lt;a class=&#34;reference external&#34; href=&#34;http://nodejs.org/&#34;&gt;Node.js&lt;/a&gt;. As it turns out, I&#39;m the first
one who has had to do this, so a blog post seemed in order.&lt;/p&gt;
&lt;p&gt;I&#39;ve loaded my Closure library in Node by creating a Node module which loads
Closure&#39;s &lt;tt class=&#34;docutils literal&#34;&gt;base.js&lt;/tt&gt;, tells Closure how to load JavaScript files, loads my
Closure library, then exports everything (the &lt;tt class=&#34;docutils literal&#34;&gt;goog&lt;/tt&gt; name space and my
namespace) through &lt;tt class=&#34;docutils literal&#34;&gt;module.exports&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;First, an &lt;tt class=&#34;docutils literal&#34;&gt;execfile&lt;/tt&gt; function is needed, which will load and evaluate a
JavaScript file using a particular namespace:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
var vm = require(&amp;quot;vm&amp;quot;);
var fs = require(&amp;quot;fs&amp;quot;);

function execfile(path) {
  var data = fs.readFileSync(path);
  vm.runInThisContext(data, path);
}
&lt;/pre&gt;
&lt;p&gt;Note: for various reasons (one of which being &lt;a class=&#34;reference external&#34; href=&#34;http://stackoverflow.com/q/8873969/71522&#34;&gt;that you can&#39;t control the value
of &#39;this&#39; from the &#39;vm&#39; module&lt;/a&gt;) &lt;tt class=&#34;docutils literal&#34;&gt;vm.runInThisContext&lt;/tt&gt; &lt;em&gt;must&lt;/em&gt; be used to load
the scripts into the &lt;em&gt;global&lt;/em&gt; context. Trying to load the into a sandbox
seems to fail for reasons I can&#39;t fully explain yet.&lt;/p&gt;
&lt;p&gt;Next, the Closure &lt;tt class=&#34;docutils literal&#34;&gt;base.js&lt;/tt&gt; and &lt;tt class=&#34;docutils literal&#34;&gt;deps.js&lt;/tt&gt; files are loaded and
&lt;tt class=&#34;docutils literal&#34;&gt;CLOSURE_IMPORT_SCRIPT&lt;/tt&gt; is set to a thin wrapper around &lt;tt class=&#34;docutils literal&#34;&gt;execfile&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
var base_basedir = &amp;quot;../src/browser/&amp;quot;;
execfile(base_basedir + &amp;quot;base.js&amp;quot;);
execfile(base_basedir + &amp;quot;deps.js&amp;quot;);
goog.global.CLOSURE_IMPORT_SCRIPT = function(path) {
  execfile(base_basedir + path);
  return true;
};
&lt;/pre&gt;
&lt;p&gt;Now Closure libraries which use &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.require(...)&lt;/span&gt;&lt;/tt&gt; and
&lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.provide(...)&lt;/span&gt;&lt;/tt&gt; can be loaded:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
execfile(&amp;quot;../src/remora.js&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;(note: only the base library needs to be loaded; its dependencies will be taken
care of by &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.require(...)&lt;/span&gt;&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;Normal JavaScript packages can also be loaded:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
execfile(&amp;quot;../libs/underscore-1.2.3.js&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;Finally, &lt;tt class=&#34;docutils literal&#34;&gt;module.exports&lt;/tt&gt; is set:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
module.exports = {
    goog: GLOBAL.goog,
    remora: GLOBAL.remora,
};
&lt;/pre&gt;
&lt;p&gt;Note: because Closure scripts expect that require/provide will inject items
into the global namespace, the global names created (ex, &lt;tt class=&#34;docutils literal&#34;&gt;goog&lt;/tt&gt; and
&lt;tt class=&#34;docutils literal&#34;&gt;remora&lt;/tt&gt;) cannot be deleted from the global namespace.&lt;/p&gt;
&lt;p&gt;And that&#39;s all there is to it. This file can now be loaded like any other Node
module (ex, &lt;tt class=&#34;docutils literal&#34;&gt;var my_closure_library = &lt;span class=&#34;pre&#34;&gt;require(&amp;quot;./closure_compat.js&amp;quot;)&lt;/span&gt;&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;For a complete example, see &lt;a class=&#34;reference external&#34; href=&#34;https://github.com/wolever/remora/blob/master/src/node/remora.dev.js&#34;&gt;remora/src/node/remora.dev.js&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Which SSD You Should Buy</title>
      <link>http://blog.codekills.net/2011/11/22/which-ssd-you-should-buy</link>
      <pubDate>Tue, 22 Nov 2011 19:32:25 EST</pubDate>
      <category>Miscellany</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/11/22/which-ssd-you-should-buy</guid>
      <description>Which SSD You Should Buy</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;I&#39;m thinking about buying a 200+ GB SSD for my laptop, and this post summarizes
my research. Note that it is current as of November 22, 2011 and will likely be
irrelevant by 2012.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; The &lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.com/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=corsair%20force%20gt&amp;amp;url=search-alias%3Daps&amp;amp;sprefix=corsair%20fo&amp;amp;_encoding=UTF8&amp;amp;tag=codekills-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=390957&#34;&gt;Corsair Force GT&lt;/a&gt; seems to be the fastest choice with
&lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.ca/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=Crucial%20M4&amp;amp;url=search-alias%3Daps&amp;amp;_encoding=UTF8&amp;amp;tag=codekills09-20&amp;amp;linkCode=ur2&amp;amp;camp=15121&amp;amp;creative=390961&#34;&gt;Crucial m4&lt;/a&gt; coming in a fairly close second. Data on failure rates for these
drives/controllers has been hard to find, though, and all signs point to Intel
drives being the most reliable (but also most expensive and slowest).&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;reference external&#34; href=&#34;http://techreport.com/articles.x/21843&#34;&gt;TechReport&#39;s SSD performance review&lt;/a&gt; which &lt;a class=&#34;reference external&#34; href=&#34;http://twitter.com/samstokes&#34;&gt;&amp;#64;samstokes&lt;/a&gt; sent me, which seems
to find the two aforementioned drives to have the best performance, with the
&lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.ca/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=force%20series%203&amp;amp;url=search-alias%3Daps?rh=k:forceseries3,i:electronics&amp;amp;_encoding=UTF8&amp;amp;tag=codekills09-20&amp;amp;linkCode=ur2&amp;amp;camp=15121&amp;amp;creative=390961&#34;&gt;Corsair Force Series 3&lt;/a&gt; making a decent showing as well. It also suggests
that the &lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.com/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=intel%20ssd&amp;amp;url=search-alias%3Daps?url=search-alias=aps&amp;amp;_encoding=UTF8&amp;amp;tag=codekills-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=390957&#34;&gt;Intel 500 series&lt;/a&gt; is a bit slower and significantly more expensive than
the competition.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923.html&#34;&gt;Tom&#39;s Hardware investigation on SSD reliability&lt;/a&gt; suggests that &lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923-4.html&#34;&gt;Intel&#39;s SSDs
are much more reliable&lt;/a&gt; (specifically their X25-M series; a sentiment I&#39;ve
read in other places too), but it doesn&#39;t compare their failure rates to other
manufacturers because &amp;quot;&lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923-9.html&#34;&gt;those are the drives that big businesses currently
trust the most&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;Friends on Twitter and Facebook generally recommended the m4.&lt;/p&gt;
&lt;p&gt;It&#39;s also worth noting that I&#39;ve read quite a few posts similar to &lt;a class=&#34;reference external&#34; href=&#34;http://www.codinghorror.com/blog/2011/05/the-hot-crazy-solid-state-drive-scale.html&#34;&gt;The
Hot/Crazy Solid State Drive Scale&lt;/a&gt; which suggest that failures can be fairly
common. These posts have mostly been more than six months old, though, so I&#39;m
hoping that most of these problems have been sorted out in newer drives (it
seems that there are often issues which can be fixed by a software update).&lt;/p&gt;
&lt;p&gt;The net result is that I&#39;m probably going to get a Force GT or m4, which ever I
can find for a reasonable price from a local retailer with a good return
policy.&lt;/p&gt;
&lt;p&gt;Disclaimer: what you see is what you get. I&#39;ve done enough research to convince
myself that an SSD isn&#39;t a terrible idea, but that&#39;s definitely far from enough
research to objectively show that an SSD isn&#39;t a terrible idea. Also, I&#39;ve
included links to Amazon for two reasons: 1) because prices change so often
that quoting them here wouldn&#39;t be that useful, and 2) I&#39;ve just setup a fancy
affiliate account, so I stand a small chance of making a small amount of money
from them.&lt;/p&gt;
&lt;img alt=&#34;https://www.assoc-amazon.com/e/ir?t=codekills-20&amp;amp;l=ur2&amp;amp;o=1&#34; src=&#34;https://www.assoc-amazon.com/e/ir?t=codekills-20&amp;amp;l=ur2&amp;amp;o=1&#34; /&gt;
&lt;img alt=&#34;https://www.assoc-amazon.ca/e/ir?t=codekills09-20&amp;amp;l=ur2&amp;amp;o=15&#34; src=&#34;https://www.assoc-amazon.ca/e/ir?t=codekills09-20&amp;amp;l=ur2&amp;amp;o=15&#34; /&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>howto: running the wifi and power at medium sized tech events</title>
      <link>http://blog.codekills.net/2011/11/07/running-wifi-and-power-at-tech-events</link>
      <pubDate>Mon, 07 Nov 2011 13:32:36 EST</pubDate>
      <category>Events</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/11/07/running-wifi-and-power-at-tech-events</guid>
      <description>howto: running the wifi and power at medium sized tech events</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;Because I&#39;ve done it a few times now and picked up a few tricks, I thought I
would write a checklist for anyone who needs (or wants) to run the wifi and
power at a medium sized (10 - 100 people) tech event.&lt;/p&gt;
&lt;p&gt;I hope that this checklist will be a useful for events like &lt;a class=&#34;reference external&#34; href=&#34;http://software-carpentry.org/&#34;&gt;Software
Carpentry&lt;/a&gt; or &lt;a class=&#34;reference external&#34; href=&#34;http://ladieslearningcode.com/&#34;&gt;Ladies Learning Code&lt;/a&gt;, as it will give someone with some
networking knowledge &lt;a class=&#34;footnote-reference&#34; href=&#34;#id5&#34; id=&#34;id1&#34;&gt;[0]&lt;/a&gt; the nuts-and-bolts they need to setup and run a great
(or at least functional) network.&lt;/p&gt;
&lt;p&gt;I&#39;ve published this document as a Gist on GitHub to make updates easy.&lt;/p&gt;
&lt;p&gt;The document: &lt;a class=&#34;reference external&#34; href=&#34;https://gist.github.com/1346886&#34;&gt;Wifi and power for medium sized tech events:
https://gist.github.com/1346886&lt;/a&gt;&lt;/p&gt;
&lt;table class=&#34;docutils footnote&#34; frame=&#34;void&#34; id=&#34;id5&#34; rules=&#34;none&#34;&gt;
&lt;colgroup&gt;&lt;col class=&#34;label&#34; /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign=&#34;top&#34;&gt;
&lt;tr&gt;&lt;td class=&#34;label&#34;&gt;&lt;a class=&#34;fn-backref&#34; href=&#34;#id1&#34;&gt;[0]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;anyone who knows the function of DHCP and the meaning of &amp;quot;default
gateway&amp;quot; should be fine.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Winter protip: hand warmers. Lots of them.</title>
      <link>http://blog.codekills.net/2011/10/31/winter-protip--hand-warmers.-lots-of-them.</link>
      <pubDate>Mon, 31 Oct 2011 00:08:47 EDT</pubDate>
      <category>Miscellany</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/10/31/winter-protip--hand-warmers.-lots-of-them.</guid>
      <description>Winter protip: hand warmers. Lots of them.</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;Now that winter is coming, I&#39;d like to share a tip that has been the difference
between a terrible and a great day: &lt;a class=&#34;reference external&#34; href=&#34;http://www.mec.ca/AST/ShopMEC/HikingCamping/HealthSafety/OutdoorSafety/PRD~4016-235/heat-factory-hand-warmer.jsp&#34;&gt;hand warmers&lt;/a&gt;. Lots of hand warmers.&lt;/p&gt;
&lt;p&gt;Here&#39;s what you do:&lt;/p&gt;
&lt;ol class=&#34;arabic simple&#34;&gt;
&lt;li&gt;Buy hand warmers. Lots of them. Like fifteen pairs of them. They are $1.20
for a pair, so no banks will be broken by having a few extras.&lt;/li&gt;
&lt;li&gt;Put a pair (or two?) in the pocket of each of your winter jackets.&lt;/li&gt;
&lt;li&gt;Use them! Next time you (or your friend/spouse/child) is uncomfortably cold,
just rip a hand warmer open. Ten minutes later you&#39;ll have a warm little
bundle of joy to stick in your boot/glove/jacket/hat.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are a bunch of reasons I&#39;ve found step three to be hard: I don&#39;t want to
admit to myself that I&#39;m &lt;em&gt;actually&lt;/em&gt; cold, I don&#39;t want to use them now because
I may need them even more in the future, or because I don&#39;t feel like the
warmth is worth the $1.20 it will cost... But since I have &lt;em&gt;never&lt;/em&gt; regretted
using one, I feel like it&#39;s worth tricking myself into using them more
liberally by keeping lots of spares around, using it &amp;quot;for a friend&amp;quot;, and
telling myself that each one only costs 60¢ (that&#39;s like two quarters!).&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>On Startups and Identity</title>
      <link>http://blog.codekills.net/2011/10/18/on-startups-and-identity</link>
      <pubDate>Tue, 18 Oct 2011 15:18:42 EDT</pubDate>
      <category>Uncategorized</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/10/18/on-startups-and-identity</guid>
      <description>On Startups and Identity</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;A curious thing I&#39;ve noticed recently is that a large number of startups don&#39;t
include any information about the identity of the founders/employees.&lt;/p&gt;
&lt;p&gt;I find this strange because, in my opinion, a big advantage of working with (or
using the product of) a startup is that I can get to know the person (or
people) behind the scenes. They might even be someone I know, or someone a
friend knows.&lt;/p&gt;
&lt;p&gt;I would go on, but I would just be repeating what Jason Cohen says in &lt;a class=&#34;reference external&#34; href=&#34;http://blog.asmartbear.com/youre-a-little-company-now-act-like-one.html&#34;&gt;You&#39;re a
little company, now act like one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, if you&#39;re part of a startup: please, include your identity and the
identity of the other founders/employees somewhere on your website.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
  </channel>
</rss>

