<?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; firefox</title>
	<atom:link href="http://o-regan.org/category/firefox/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>XPISigner v1.6 released</title>
		<link>http://o-regan.org/2007/10/01/xpisigner-v16-released/</link>
		<comments>http://o-regan.org/2007/10/01/xpisigner-v16-released/#comments</comments>
		<pubDate>Sun, 30 Sep 2007 23:02:55 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[firefox]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>
		<category><![CDATA[release]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=19</guid>
		<description><![CDATA[Available from the download page. Version 1.6 Fixed FileNotFound exception for xpi output file that doesnÃ¢â‚¬â„¢t exist (yet). XPISigner now creates the file entry so the jar operation can use it. Updated the unix script Readme now correctly refers to the unix script as xpisigner.sh]]></description>
			<content:encoded><![CDATA[<p>Available from the <a href="http://o-regan.org/xpisigner-secure-your-firefox-extensions/download-xpisigner/">download</a> page. </p>
<p><strong><u>Version 1.6</u></strong></p>
<ul>
<li>Fixed FileNotFound exception for xpi output file that doesnÃ¢â‚¬â„¢t exist (yet). XPISigner now creates the file entry so the jar operation can use it. </li>
<li>Updated the unix script </li>
<li>Readme now correctly refers to the unix script as xpisigner.sh</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/10/01/xpisigner-v16-released/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>InvalidKeyException: Illegal key size issue</title>
		<link>http://o-regan.org/2007/08/03/invalidkeyexception-illegal-key-size-issue/</link>
		<comments>http://o-regan.org/2007/08/03/invalidkeyexception-illegal-key-size-issue/#comments</comments>
		<pubDate>Fri, 03 Aug 2007 21:49:53 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[faq]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>
		<category><![CDATA[xpisigner]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=11</guid>
		<description><![CDATA[When running XPISigner with a PFX generated from&#160;SPC &#38; PVK&#160;files you may run into the following error&#8230; &#8220;unwrapping private key &#8211; java.security.InvalidKeyException: Illegal key size&#8221; This may have two causes: The unlimited strength policy files are not installed in your %JAVA_HOME%/jre/lib/security folder. The PFX that was generated is not well formed. See below for instructions [...]]]></description>
			<content:encoded><![CDATA[<p>When running XPISigner with a PFX generated from&nbsp;SPC &amp; PVK&nbsp;files you may run into the following error&#8230;</p>
<p><em>&#8220;unwrapping private key &#8211; java.security.InvalidKeyException: Illegal key size&#8221;</em></p>
<p>This may have two causes:</p>
<ul>
<li>The unlimited strength policy files are not installed in your <br /><font face="Courier New">%JAVA_HOME%/jre/lib/security</font> folder.</li>
<li>The PFX that was generated is not well formed. See below for instructions on how to export a correctly formatted PFX from IE.</li>
</ul>
<h2>Exporting a PFX from Internet Explorer</h2>
<p>Go to <font face="Courier New"><strong>Tools | Internet Options | Content | Certificates</strong></font> </p>
<p>Select your cert/key and click Export&#8230; </p>
<p>Choose to export the private key. </p>
<p>On the next screen choose to &#8220;Include all certificates in the chain&#8221; and &#8220;Strong private key protection&#8221; </p>
<p>Give it a password and save to a different filename.</p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/08/03/invalidkeyexception-illegal-key-size-issue/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Why write XPISigner?</title>
		<link>http://o-regan.org/2007/05/05/why-write-xpisigner/</link>
		<comments>http://o-regan.org/2007/05/05/why-write-xpisigner/#comments</comments>
		<pubDate>Sat, 05 May 2007 21:44:51 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=9</guid>
		<description><![CDATA[I&#8217;ve been working on a firefox extension in my spare time, a little something that&#8217;s not quite ready for primetime yet. Having worked in the security industry for the last 7 years I was conscious that my extension probably wouldn&#8217;t be accepted by very many people if it wasn&#8217;t signed.[1] The closest thing to &#8216;official&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on a firefox extension in my spare time, a little something that&#8217;s not quite ready for primetime yet. Having worked in the security industry for the last 7 years I was conscious that my extension probably wouldn&#8217;t be accepted by very many people if it wasn&#8217;t signed.<sup><a href="#one">[1]</a></sup> The closest thing to &#8216;official&#8217; documentation on signing an extension is <a href="https://www.mozdevgroup.com/docs/pete/Signing-an-XPI.html" onclick="pageTracker._trackPageview('/outgoing/www.mozdevgroup.com/docs/pete/Signing-an-XPI.html?referer=');">Signing-an-XPI</a> (mozdevgroup.org).</p>
<blockquote><p><em>After a couple of days of pain, I&#8217;ve decided to write up a doc on how I was able to successfully sign an xpi using a test cert. For no better reason than I know I will forget by next week and honestly I wouldn&#8217;t want to wish the pain I endured doing this on others.</em></p></blockquote>
<p>Great, this guy has done all the hard figuring out and is going to give us the couple of steps needed to do the job&#8230;</p>
<blockquote><p><em><strong>Step 1 &#8211; Build NSS</strong> First off you will need to fetch and compile the NSS tools you will need to do this. Sorry, there is no way around this.</em></p></blockquote>
<p>Hey! I wanted to sign an extension, not compile the security subsystem of Mozilla. I&#8217;m off elsewhere &#8230; <a href="http://oy-oy.eu/huh/firefox-extension-code-signed-with-spc-pvk/" onclick="pageTracker._trackPageview('/outgoing/oy-oy.eu/huh/firefox-extension-code-signed-with-spc-pvk/?referer=');">http://oy-oy.eu/huh/firefox-extension-code-signed-with-spc-pvk/</a> At least this time it only involves several binary downloads, but you have to set PATHs etc so that&#8217;s going to put people off. Has no-one sat down and created a simple tool that doesn&#8217;t require you do download zips from here and exes from there? &#8230; guess not. I didn&#8217;t really want to have to do it but in then end there wasn&#8217;t really a choice. I pulled the source for the latest firefox release (2.0.0.3), grabbed a signed extension (google toolbar) and sat myself down to figure out what it was that kept people from making this easy. <a href="http://o-regan.org/2007/04/11/firefox-xpi-internal-structure/">Firefox XPI Internal Structure</a> is a look at how the verification process works and <a href="http://o-regan.org/2007/04/23/extension-signing-with-xpisigner/" title="Signing with XPISigner">XPISigner</a> is the fruit of my labours.</p>
<hr /><a name="one" title="one"></a><sup>1</sup>I don&#8217;t think I needed to worry, Firefox users don&#8217;t seem to care if their extensions are signed. </p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/05/05/why-write-xpisigner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extension signing with XPISigner</title>
		<link>http://o-regan.org/2007/04/23/extension-signing-with-xpisigner/</link>
		<comments>http://o-regan.org/2007/04/23/extension-signing-with-xpisigner/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 21:41:45 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[firefox]]></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=8</guid>
		<description><![CDATA[A random sampling of the extensions available on addons.mozilla.org shows that the majority of extensions available for download are unsigned. The only signed extension found in the search was the Google Toolbar. The use of unsigned extensions encourages the end user to ignore the Unsigned warning in the corner. (I&#8217;m not picking on Adblock specifically, [...]]]></description>
			<content:encoded><![CDATA[<p>A random sampling of the extensions available on <a HREF="https://addons.mozilla.org" onclick="pageTracker._trackPageview('/outgoing/addons.mozilla.org?referer=');">addons.mozilla.org</a> shows that the majority of extensions available for download are unsigned. The only signed extension found in the search was the Google Toolbar.</p>
<p>The use of unsigned extensions encourages the end user to ignore the <strong STYLE="color: #ff0000">Unsigned</strong> warning in the corner.</p>
<p><img SRC="http://o-regan.org/wp-content/uploads/2007/04/addblock_unsigned.png" ALT="addblock_unsigned.png" /></p>
<p><em>(I&#8217;m not picking on Adblock specifically, it was the featured extension when I last visited the mozilla addons site.)</em></p>
<p>So if you&#8217;ve developed a firefox extension and you decide you want to sign your extension so that your users can easily authenticate it. What next?</p>
<p>You&#8217;ll need a code-signing (or object signing) certificate from a Certificate Authority. For example a Netscape compatible codesigning certificate from Globalsign can be purchased for Ã¢â€šÂ¬175 for one year.</p>
<p>If you follow the registration process from your browser then your private key and certificate will be stored in your browsers certificate store.</p>
<p>To use them with XPISigner you&#8217;ll have to export them to a file.</p>
<p>Both Firefox and IE use the same secure format for storing keys outside the browser. The Personal Information Exchange (PFX) file is based on the <a TITLE="PKCS#12 Standard" HREF="http://www.rsa.com/rsalabs/node.asp?id=2138" onclick="pageTracker._trackPageview('/outgoing/www.rsa.com/rsalabs/node.asp?id=2138&amp;referer=');">PKCS#12</a> standard. It&#8217;s format ensures that the exported details are kept secure and provides evidence if the file was tampered with.</p>
<p>In Firefox to export your private key and signing certificate you need to:</p>
<p>Open the options dialog under <strong>Tools</strong> | <strong>Options</strong>. Click on the <strong>Advanced</strong> section and then on the Encryption tab.</p>
<p>Click on the &#8220;<strong>View Certificates</strong>&#8221; button and select your certificate.</p>
<p>Click on <strong>Backup</strong>, enter your master password and then enter a new password to protect the exported key and certificate.</p>
<p>Your p12 or pfx file can now be used with XPISigner.</p>
<p>Downloading &amp; Installing XPISigner</p>
<p>XPISigner is a java application and requires a Java5 runtime installed.</p>
<p>Download the latest version from the <a TITLE="Download XPISigner" HREF="http://o-regan.org/xpisigner-secure-your-firefox-extensions/">XPISigner page.</a></p>
<p>It should be unpacked to a folder on your disk. e.g. <code>c:\tools\xpisigner</code></p>
<p>Open a command prompt (Start | Run&#8230; | cmd.exe)</p>
<pre>CD c:/tools/xpisigner
 C:/tools/xpisigner&gt;dir /b
 bcmail-jdk15-136.jar
 bcprov-jdk15-136.jar
 readme.txt
 xpi.jar
 xpisigner.cmd</pre>
<p>Check that java is available from the commandline:</p>
<pre>C:/tools/xpisigner&gt;java -version
 java version "1.5.0_06"
 Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
 Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode)</pre>
<p>For the purposes of this tutorial I downloaded the Adblock Plus extension and unpacked it in <code>C:\tools\extn</code></p>
<p>My exported codesigning p12 is in <code>c:\tools\xpisigner1.2\exported.p12</code> and it&#8217;s password is <code>password</code>.</p>
<p>So to sign the Adblock extension you switch to the extension directory and  run:</p>
<pre>C:/tools/extn&gt;c:/tools/xpisigner/xpisigner.cmd c:/tools/xpisigner/exported.p12 password
c:/tools/extn c:/tools/adblock.xpi
XPISigner v1.3 (http://o-regan.org/xpisigner-secure-your-firefox-extensions)
Copyright 2007 - Kevin O'Regan      

Excluding: []
Generated XPI...
        Filename:    C:/tools/adblock.xpi
        Size:        228 kb
        Created at:  Mon Apr 23 23:09:46 BST 2007
        Signed by:   O=O'Regan dot org,E=xpisigner@o-regan.org,C=IE,CN=XPI Signer
        Num entries: 10
Done.</pre>
<p>The output <code>c:\tools\adblock.xpi</code> can be dragged into Firefox to install it. This time you can see that it is signed.<br />
<img ALT="addblock_signed.png" SRC="http://o-regan.org/wp-content/uploads/2007/04/addblock_signed.png" /></p>
<p>I&#8217;ve uploaded the <a HREF="http://o-regan.org/adblock.xpi">signed adblock extension</a> but you&#8217;ll need to install my &#8216;fake&#8217; <a HREF="http://o-regan.org/oregan.org.cacert">CA certificate</a> before the extension will verify.</p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/04/23/extension-signing-with-xpisigner/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>XPISigner &#8211; Java cross-platorm xpi signing tool</title>
		<link>http://o-regan.org/2007/04/14/xpisigner-java-cross-platorm-xpi-signing-tool/</link>
		<comments>http://o-regan.org/2007/04/14/xpisigner-java-cross-platorm-xpi-signing-tool/#comments</comments>
		<pubDate>Sat, 14 Apr 2007 20:39:58 +0000</pubDate>
		<dc:creator>kevin</dc:creator>
				<category><![CDATA[extension]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[signtool]]></category>
		<category><![CDATA[xpi]]></category>

		<guid isPermaLink="false">http://o-regan.org/?p=7</guid>
		<description><![CDATA[XPISigner creates signed extensions or plug-ins for Firefox and Thunderbird. It is a replacement for signtool.exe Requirements: Java 5 or higher PKCS#12 (PFX) file containing your signing key and certificate Your unpacked xpi directory structure To sign the xpi file you need to point XPISigner at the directory containing your unpacked xpi. XPISigner processes each [...]]]></description>
			<content:encoded><![CDATA[<p>XPISigner creates signed extensions or plug-ins for Firefox and Thunderbird.</p>
<p>It is a replacement for signtool.exe</p>
<p>Requirements:</p>
<ul>
<li>Java 5 or higher</li>
<li>PKCS#12 (PFX) file containing your signing key and certificate</li>
<li>Your unpacked xpi directory structure</li>
</ul>
<p>To sign the xpi file you need to point XPISigner at the directory containing your unpacked xpi.</p>
<p>XPISigner processes each file in the directory calculating the MD5 and SHA-1 hash values required for the manifest.mf and zigbert.sf files.</p>
<p>Once the hashes are calculated a PKCS#7 detached signature blob is created using the signing key provided. The PKCS#7 signature is saved as zigbert.rsa.</p>
<p>Finally the xpi is created. The XPI is a regular zip file with one caveat; for a signed xpi the &#8220;META-INF/zigbert.rsa&#8221; file must be stored first in the archive.</p>
<p>You can now test your signed xpi in Firefox.  </p>
<p>XPISigner can be downloaded from <a href="http://o-regan.org/xpisigner-secure-your-firefox-extensions">http://o-regan.org/xpisigner-secure-your-firefox-extensions</a><a href="http://o-regan.org/"></a> </p>
]]></content:encoded>
			<wfw:commentRss>http://o-regan.org/2007/04/14/xpisigner-java-cross-platorm-xpi-signing-tool/feed/</wfw:commentRss>
		<slash:comments>0</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>

