canmove, Confirmed users
1,448
edits
(Updated overview, included links to MDN and Signing API for extension devs who find this page.) |
(Updated text for the removal of Aurora, and some other tweaks) |
||
| Line 5: | Line 5: | ||
Extension signing is controlled by Mozilla and requires access to a private signing infrastructure exposed by [https://addons.mozilla.org/ AMO], and internal services like [https://github.com/mozilla-services/autograph Autograph]. | Extension signing is controlled by Mozilla and requires access to a private signing infrastructure exposed by [https://addons.mozilla.org/ AMO], and internal services like [https://github.com/mozilla-services/autograph Autograph]. | ||
Add-ons and Extensions are XPI files (zip archives) where each file in the archives is hashed, and the manifest containing all the hashes is signed. When signing an extension, a manifest file containing the hash of each file in the XPI is first generated. The manifest file is stored in the signed XPI under '''META-INF/manifest.mf'''. The snippet below shows an example of manifest file. | |||
<source> | <source> | ||
Manifest-Version: 1.0 | Manifest-Version: 1.0 | ||
| Line 32: | Line 32: | ||
</source> | </source> | ||
A PKCS7 detached signature is computed on "mozilla.sf", using a signing certificate generated for each signature. The signing certificate, also called end-entity cert, is issued by an intermediate certificate of the Firefox private PKI. No special key usage or extended key usage is required in the end-entity cert, but its subject CN must match the | A PKCS7 detached signature is computed on "mozilla.sf", using a signing certificate generated for each signature. The signing certificate, also called end-entity cert, is issued by an intermediate certificate of the Firefox private PKI. No special key usage or extended key usage is required in the end-entity cert, but its subject CN must match the add-on ID (for example, add-on ID test@tests.mozilla.org would have a cert CN set to that value). | ||
Note: If the | Note: If the add-on ID is longer than 64 characters, we use the SHA256 hash of the add-on ID in the end-entity subject CN, to work around issues with long string in certificates (see [https://bugzilla.mozilla.org/show_bug.cgi?id=1203787 bug 1203787]). | ||
The [https://tools.ietf.org/html/rfc2315 PKCS #7 (section 9.1 SignedData type)] signature is a binary file stored in the XPI under '''META-INF/mozilla.rsa'''. Because it is a standard PKCS7 signature, it can be verified using OpenSSL, as follows: | The [https://tools.ietf.org/html/rfc2315 PKCS #7 (section 9.1 SignedData type)] signature is a binary file stored in the XPI under '''META-INF/mozilla.rsa'''. Because it is a standard PKCS7 signature, it can be verified using OpenSSL, as follows: | ||
| Line 50: | Line 50: | ||
but shipped with Firefox directly. | but shipped with Firefox directly. | ||
When installing | When installing add-ons, Firefox does the following verifications: | ||
* verify the signature of `mozilla.sf` using `mozilla.rsa` | * verify the signature of `mozilla.sf` using `mozilla.rsa` | ||
| Line 58: | Line 58: | ||
* verify all files in the XPI are listed in `manifest.mf` | * verify all files in the XPI are listed in `manifest.mf` | ||
=== Signing of special | === Signing of special add-ons === | ||
There are three special cases of | There are three special cases of add-ons developed by Mozilla: System add-ons, Mozilla Extensions and Hotfixes. | ||
If the | If the add-on is a system add-on, the Organizational Unit (OU) of the end-entity certificate must be set to "Mozilla Components". | ||
If the | If the add-on is a Mozilla Extension, the OU of the EE cert must be set to "Mozilla Extensions". | ||
If the | If the add-on is a hotfix, the add-on ID must match the pref `extensions.hotfix.id` | ||
(currently `firefox-hotfix@mozilla.org`) and the public key hash of the end-entity cert must match the fingerprints set in `extensions.hotfix.certs.1.sha1Fingerprint` or | (currently `firefox-hotfix@mozilla.org`) and the public key hash of the end-entity cert must match the fingerprints set in `extensions.hotfix.certs.1.sha1Fingerprint` or | ||
`extensions.hotfix.certs.2.sha1Fingerprint`. | `extensions.hotfix.certs.2.sha1Fingerprint`. | ||
| Line 89: | Line 89: | ||
All Firefox extensions - for Desktop and Android - on AMO that have passed review are now signed. | All Firefox extensions - for Desktop and Android - on AMO that have passed review are now signed. | ||
For unlisted (non-AMO) add-ons, submission and signing is active through [https://addons.mozilla.org AMO], and there is a [https://blog.mozilla.org/addons/2015/11/20/signing-api-now-available/ Signing API available] for automated submission and retrieval of unlisted | For unlisted (non-AMO) add-ons, submission and signing is active through [https://addons.mozilla.org AMO], and there is a [https://blog.mozilla.org/addons/2015/11/20/signing-api-now-available/ Signing API available] for automated submission and retrieval of unlisted add-ons. | ||
== Unbranded Builds == | == Unbranded Builds == | ||
| Line 144: | Line 144: | ||
* What are my options if I want to install unsigned extensions in Firefox? | * What are my options if I want to install unsigned extensions in Firefox? | ||
** The | ** The [https://nightly.mozilla.org/ Nightly] versions of Firefox have a preference to disable signature enforcement. There are also be special [https://wiki.mozilla.org/Add-ons/Extension_Signing#Unbranded_Builds unbranded versions of Release and Beta] that have this preference, so that add-on developers can work on their add-ons without having to sign every build. To disable signature checks, you will need to set the <code>xpinstall.signatures.required</code> preference to "false". | ||
*** type <code>about:config</code> into the URL bar in Firefox | *** type <code>about:config</code> into the URL bar in Firefox | ||
*** in the Search box type <code>xpinstall.signatures.required</code> | *** in the Search box type <code>xpinstall.signatures.required</code> | ||
*** double-click the preference, or right-click and selected "Toggle", to set it to <code>false</code>. | *** double-click the preference, or right-click and selected "Toggle", to set it to <code>false</code>. | ||
* How | * How do the [[Add-ons/Extension_Signing#Unbranded_Builds|unbranded versions of Firefox]] work? | ||
** They work just like Firefox, with two differences: they | ** They work just like Firefox, with two differences: they have a setting to disable mandatory signature checks, and they don't have the Firefox name and logo (instead using a generic name and logo). These builds are available in the en-US locale only. | ||
* What about private add-ons used in enterprise environments? | * What about private add-ons used in enterprise environments? | ||
** The ESR release | ** The ESR release supports signing starting with version 45-based releases. Signing enforcement is enabled by default in these releases, and enforcement can be disabled using the <code>xpinstall.signatures.required</code> preference. | ||
* How do I get my add-ons signed if they are hosted on addons.mozilla.org (AMO)? | * How do I get my add-ons signed if they are hosted on addons.mozilla.org (AMO)? | ||
| Line 164: | Line 164: | ||
* How does the signing process work for unlisted add-ons? | * How does the signing process work for unlisted add-ons? | ||
** For unlisted add-ons, files submitted for signing | ** For unlisted add-ons, files submitted for signing go through an automated review process. If they pass this review, they are automatically signed and a download link is sent back to the developer. This process should normally take seconds. | ||
** There is an [http://olympia.readthedocs.org/en/latest/topics/api/signing.html API you can use] for signing. | ** There is an [http://olympia.readthedocs.org/en/latest/topics/api/signing.html API you can use] for signing. | ||
| Line 174: | Line 174: | ||
* Is this a way for Mozilla to censor add-ons they don't like, enforce copyright, government demands, etc.? | * Is this a way for Mozilla to censor add-ons they don't like, enforce copyright, government demands, etc.? | ||
** No, the purpose of this is to protect users from malicious add-ons. We have [https://developer.mozilla.org/en-US/Add-ons/ | ** No, the purpose of this is to protect users from malicious add-ons. We have [https://developer.mozilla.org/en-US/Add-ons/AMO/Policy/Reviews a set of guidelines] for when it is appropriate to blocklist an add-on and have refused multiple times to block for other reasons. | ||
* Will there be an upload and signing API so I don't have to manually upload each new version of the add-on? | * Will there be an upload and signing API so I don't have to manually upload each new version of the add-on? | ||