<?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>o-regan.org &#187; codesigning</title>
	<atom:link href="http://o-regan.org/category/codesigning/feed/" rel="self" type="application/rss+xml" />
	<link>http://o-regan.org</link>
	<description>Quality iPhone Apps</description>
	<lastBuildDate>Thu, 30 Jun 2011 10:12:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>XPISigner removed</title>
		<link>http://o-regan.org/2011/06/30/xpisigner-removed/</link>
		<comments>http://o-regan.org/2011/06/30/xpisigner-removed/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 10:12:01 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[xpi]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=205</guid>
		<description><![CDATA[I&#8217;ve removed XPISigner from this site. It no longer appears to work correctly with FireFox 4 and 5 and I no longer have the time/resources to try keeping up with it. The source code is available on Google Code : http://code.google.com/p/xpisigner/]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve removed XPISigner from this site. It no longer appears to work correctly with FireFox 4 and 5 and I no longer have the time/resources to try keeping up with it.</p>
<p>The source code is available on Google Code : http://code.google.com/p/xpisigner/</p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2011/06/30/xpisigner-removed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Possible issue with XPISigner and Firefox 4</title>
		<link>http://o-regan.org/2011/03/29/possible-issue-with-xpisigner-and-firefox-4/</link>
		<comments>http://o-regan.org/2011/03/29/possible-issue-with-xpisigner-and-firefox-4/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 13:54:33 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>
		<category><![CDATA[firefox extension]]></category>
		<category><![CDATA[xpisigner]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=197</guid>
		<description><![CDATA[Some xpi archives signed with xpisigner are failing to be verified in Firefox 4. Signature Verification Error: the signature on this .jar archive is invalid because the digital signature (*.RSA) file is not a valid signature of the signature instruction file (*.SF). The signatures appear to be correct and it appears to be the chaining [...]]]></description>
			<content:encoded><![CDATA[<p>Some xpi archives signed with xpisigner are failing to be verified in Firefox 4.</p>
<blockquote><p>Signature Verification Error: the signature on this .jar archive is invalid because the digital signature (*.RSA) file is not a valid signature of the signature instruction file (*.SF).</p></blockquote>
<p>The signatures appear to be correct and it appears to be the chaining via intermediate certificates that is causing the issue.</p>
<p>This is being investigated now and should have an update tomorrow.</p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2011/03/29/possible-issue-with-xpisigner-and-firefox-4/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>COMODO knowledgebase adds XPISigner entry</title>
		<link>http://o-regan.org/2009/05/23/comodo-knowledgebase-adds-xpisigner-entry/</link>
		<comments>http://o-regan.org/2009/05/23/comodo-knowledgebase-adds-xpisigner-entry/#comments</comments>
		<pubDate>Sat, 23 May 2009 08:46:40 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[xpi]]></category>
		<category><![CDATA[xpisigner comodo knowledgebase faq]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=97</guid>
		<description><![CDATA[Just noticed that there&#8217;s an entry for signing xpi files with XPISigner in the Comodo knowledgebase. Using XPISigner to sign XPI files]]></description>
			<content:encoded><![CDATA[<p>Just noticed that there&#8217;s an entry for signing xpi files with XPISigner in the Comodo knowledgebase.</p>
<p><a href="https://support.comodo.com/index.php?_m=knowledgebase&#038;_a=viewarticle&#038;kbarticleid=1236&#038;ratingconfirm=1" onclick="pageTracker._trackPageview('/outgoing/support.comodo.com/index.php?_m=knowledgebase_038_a=viewarticle_038_kbarticleid=1236_038_ratingconfirm=1&amp;referer=');">Using XPISigner to sign XPI files</a></p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2009/05/23/comodo-knowledgebase-adds-xpisigner-entry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signing a Firefox plug-in</title>
		<link>http://o-regan.org/2007/10/09/signing-a-firefox-plug-in/</link>
		<comments>http://o-regan.org/2007/10/09/signing-a-firefox-plug-in/#comments</comments>
		<pubDate>Tue, 09 Oct 2007 22:57:57 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>
		<category><![CDATA[tip]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=17</guid>
		<description><![CDATA[Laurent brought this up recently in the comments on the XPISigner download page. He ran into an issue signing his Firefox Linux plug-in with XPISigner. Some files were no longer executable when the XPI was deployed. This is a &#8216;feature&#8217; of java&#8217;s cross-platform underpinnings, since not all platforms use file-system metadata to flag files as [...]]]></description>
			<content:encoded><![CDATA[<p>Laurent brought this up recently in the comments on the XPISigner <a href="http://o-regan.org/xpisigner-secure-your-firefox-extensions/download-xpisigner/" target="_blank">download page</a>. He ran into an issue signing his Firefox Linux plug-in with XPISigner. Some files were no longer executable when the XPI was deployed.</p>
<p>This is a <a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6194856" target="_blank" onclick="pageTracker._trackPageview('/outgoing/bugs.sun.com/bugdatabase/view_bug.do?bug_id=6194856&amp;referer=');">&#8216;feature&#8217;</a> of java&#8217;s cross-platform underpinnings, since not all platforms use file-system metadata to flag files as executable.</p>
<p>You can work around this using a combination of XPISigner and the unix ZIP command.</p>
<p>Zip (on unix) will preserve the exec flag when creating the archive and Firefox will honour the setting when it extracts the contents of the xpi during installation.</p>
<h2></h2>
<h2>Instructions</h2>
<ul>
<li>Run xpisigner to create the file manifests and signature.
<li>Delete your output xpi file
<li>Zip your content directory and rename your output file to .xpi</li>
</ul>
<h3></h3>
<h3>Note</h3>
<p>You may need to give ZIP an inclusion file list and make sure that META-INF/zigbert.rsa is the first file in the archive
<p>e.g. zip outfile.xpi -i@include.lst
<p>Where include.lst is a file listing all the files you want in the archive.
<p>See <a href="http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/">http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/</a> for the reasoning. <br /><</p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/10/09/signing-a-firefox-plug-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>XPISigner v 1.5 released</title>
		<link>http://o-regan.org/2007/08/15/xpisigner-v-15-released-2/</link>
		<comments>http://o-regan.org/2007/08/15/xpisigner-v-15-released-2/#comments</comments>
		<pubDate>Tue, 14 Aug 2007 23:04:41 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[extension]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=20</guid>
		<description><![CDATA[Now available from the download page. Updated the readme.txt in the zip to the latest version. Some VM&#8217;s displayed FileNotFound exceptions when the META-INF folder didn&#8217;t exist. Added explicit checks and create folders as required. Removed some debugging statements e.g., &#8220;bc&#8221; from the output. When running from a folder other than the baseDir the value [...]]]></description>
			<content:encoded><![CDATA[<p><a HREF="http://o-regan.org/xpisigner-secure-your-firefox-extensions/download-xpisigner/">Now available from the download page.</a></p>
<ul>
<li>Updated the readme.txt in the zip to the latest version.</li>
<li>Some VM&#8217;s displayed <em>FileNotFound</em> exceptions when the META-INF folder didn&#8217;t exist. Added explicit checks and create folders as required.</li>
<li>Removed some debugging statements e.g., &#8220;bc&#8221; from the output.</li>
<li>When running from a folder other than the baseDir the value of baseDir needed to fully qualified. Now you can use relative paths e.g., ..\..\src</li>
<li><em>Some PFX files fail to load and cause an &#8220;IllegalKeySize&#8221; exception. This is still being investigated.</em></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/08/15/xpisigner-v-15-released-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Firefox XPI Internal Structure</title>
		<link>http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/</link>
		<comments>http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/#comments</comments>
		<pubDate>Wed, 11 Apr 2007 14:34:55 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[codesigning]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[xpi]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=6</guid>
		<description><![CDATA[Let&#8217;s take a signed XPI apart and see what&#8217;re required to build a tool like XPISigner We&#8217;ll use the Google Toolbar for Firefox as an example. It&#8217;s already signed and we can see it works when we download it. Save off the xpi file from http://dl.google.com/firefox/google-toolbar.xpi]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s take a signed XPI apart and see what&#8217;re required to build a tool like <a href="http://o-regan.org/?page_id=3">XPISigner</a></p>
<p>We&#8217;ll use the Google Toolbar for Firefox as an example. It&#8217;s already signed and we can see it works when we download it.</p>
<p><img src="http://o-regan.org/wp-content/uploads/2007/04/firefox_win_confirm.png" alt="Firefox XPI install confirmation dialog." title="Firefox XPI install confirmation dialog." /></p>
<p>Save off the xpi file from <a href="http://dl.google.com/firefox/google-toolbar.xpi" title="Google Toolbar" onclick="pageTracker._trackPageview('/outgoing/dl.google.com/firefox/google-toolbar.xpi?referer=');">http://dl.google.com/firefox/google-toolbar.xpi</a></p>
<p><a<br />
</a<br />
Using Java's jar command view the contents of the archive</p>
<pre>C:demo&gt;jar tvf google-toolbar-win.xpi
   3247 Tue Feb 20 12:33:50 GMT 2007 META-INF/zigbert.rsa
 573920 Sat Feb 17 15:01:32 GMT 2007 chrome/google-toolbar.jar
   2599 Sat Feb 17 15:01:32 GMT 2007 chrome.manifest
   7824 Sat Feb 17 15:01:32 GMT 2007 components/bootstrap.js
   4578 Sat Feb 17 15:01:32 GMT 2007 components/googletoolbar.xpt
   1126 Sat Feb 17 15:01:32 GMT 2007 components/metrics.xpt
 351232 Sat Feb 17 15:01:32 GMT 2007 components/googletoolbar.dll
 138752 Sat Feb 17 15:01:32 GMT 2007 components/metrics.dll
   4340 Sat Feb 17 15:01:32 GMT 2007 defaults/preferences/options.js
   2005 Sat Feb 17 15:01:32 GMT 2007 defaults/custombuttons/toolbar.google.com_CTK0Y7F4MTG6NKYH03WT.xml
   6697 Sat Feb 17 15:01:32 GMT 2007 defaults/custombuttons/toolbar.google.com_J66T77NJDBMW4FEUU7FA.xml
   7667 Sat Feb 17 15:01:32 GMT 2007 defaults/custombuttons/toolbar.google.com_O8Y91YHB24Z6SR0SGYSK.xml
  22486 Sat Feb 17 15:01:32 GMT 2007 defaults/contenthandling/doc.ico
   2446 Sat Feb 17 15:01:32 GMT 2007 install.rdf
 544031 Sat Feb 17 15:01:32 GMT 2007 lib/toolbar.js
   7789 Sat Feb 17 15:01:32 GMT 2007 LICENSE.txt
   2303 Tue Feb 20 12:33:50 GMT 2007 META-INF/manifest.mf
   2411 Tue Feb 20 12:33:50 GMT 2007 META-INF/zigbert.sf</pre>
<p>The jar command lists the files in the order they were found in the archive. This is important as it plays a role in how Firefox determines that the archive is signed. Tools like WinZIP will re-order the listing by path.</p>
<p>There are 3 files of intrest to this investigation:</p>
<ol>
<li><code>META-INF/zigbert.rsa</code> is a PKCS#7 detached<br />
signature.</li>
<li><code>META-INF/manifest.mf</code> is a jar file manifest</li>
<li><code>META-INF/zigber.sf</code> is a manifest of manifest.mf</li>
</ol>
<p>The reason that <code>zigbert.rsa</code> must be at the start of the archive is so that Firefox can determine if the archive is signed and display the signer's Organization in the confirmation dialog.</p>
<p>Firefox downloads just enough of the archive to extract the first entry from it. If that entry is <code>zigbert.rsa</code> and it is a well-formed PKCS#7 signature then the signer's Distinguished Name is taken from the signer info and the organization is displayed.</p>
<p>e.g., the full Distinguished Name for the google signing certificate is</p>
<p>CN = Google Inc<br />
OU = Digital ID Class 3 - Netscape Object Signing<br />
O = Google Inc<br />
L = Mountain View<br />
S = California<br />
C = US</p>
<p><em>The signer must be either in the Firefox certificate store or be signed by a CA in the certificate store</em></p>
<p>This way the user is told that the xpi is signed and who signed it, before the complete archive is downloaded. If the user cancels at this point then no more of the file is downloaded.</p>
<p>When the user accepts the xpi for installation it is downloaded. Once the download is completed Firefox finishes the verification steps.</p>
<p>Each file in the archive is extracted and the MD5 and SHA-1 hashes are calculated. The values are checked against the ones stored in <code>manifest.mf</code>. If there is a mismatch then verification fails. If there are more (or less) files files in the archive than listed in the manifest then verification fails.</p>
<p>If the manifest has been checked successfully then the signature manifest (zigbert.sf) is checked. The <code>manifest.mf</code> is split into sections based on blank lines. Each section has it's MD5 and SHA-1 hash calculated and compared to the corresponding values in <code>zigbert.sf</code>. If any of the entries do not match then verification fails.</p>
<p>The contents of zigbert.sf is used to verify the PKCS#7 signature in zigbert.rsa.</p>
<p>If that signature verifies and the certificate used to sign zigbert.rsa verifies against the Firefox certificate store then the xpi is staged for installation. </p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

