Closed Bug 1150199 Opened 11 years ago Closed 11 years ago

Allow Langpacks to be signed and un-privileged

Categories

(Core Graveyard :: DOM: Apps, defect)

40 Branch
defect
Not set
normal

Tracking

(firefox38 wontfix, firefox39 wontfix, firefox40 fixed, b2g-v2.2 fixed, b2g-master fixed)

RESOLVED FIXED
mozilla40
Tracking Status
firefox38 --- wontfix
firefox39 --- wontfix
firefox40 --- fixed
b2g-v2.2 --- fixed
b2g-master --- fixed

People

(Reporter: stas, Assigned: fabrice)

Details

Attachments

(1 file)

I'm filing this in the Marketplace product but this might also be a Gecko bug. Despite bug 1122277, it's not possible to install langpacks unless the following pref is set: user_pref("dom.apps.allow_unsigned_langpacks", true); Could it be that we're not actually signing langpacks?
I downloaded the first langpack from the answer of https://marketplace.firefox.com/api/v2/langpacks/?dev=firefoxos&fxos_version=3.0 and it seems signed. I'm investigating further.
Thanks, Fabrice. The comment in line 506 and the code in http://mxr.mozilla.org/mozilla-central/source/dom/apps/AppsUtils.jsm#514 seem to imply that Gecko expects langpacks to be privileged, while they shouldn't. They're regular un-privileged apps with signed packages. Could this be related?
Yes, this is it. You need to set the type to "privileged" since we don't really support unprivileged signed apps. How bad is that to do this change on your side?
We wanted to default to the more open setting and since langpacks don't use any APIs, un-privileged seemed good. I recall Mat's first implementation of the Marketplace's langpack chacker actually required langpacks to be privileged but I asked him to change that. If we were to require langpacks to be privileged, we'll need to: - change the langpack builder to add type: privileged to langpacks' manifests, - change the langpack checker to require submitted langpacks to be privileged, - re-upload existing (testing) langpacks (no biggie). Before we move on, can we make sure this is the only way? I really appreciated the fact that we managed to keep langpacks un-privileged and changing that would seem like a step backwards. Also NI'ing Freddy in case this has security implications. Privileged langpacks could in theory access some device APIs, but then, they don't have any code in them, so maybe that's fine. Especially given that they are already run in the context of other apps which are often certified.
Flags: needinfo?(fbraun)
I'm sorry for the misunderstanding there. Until now we always considered that signed === privileged. We could special case apps with a langpack role to need a signature even if they are not privileged. I'm a bit nervous doing that so late in the 2.2 cycle but that's possible.
That passes tests. Stas, can you verify with a langpack from the marketplace?
Assignee: nobody → fabrice
Attachment #8587048 - Flags: feedback?(stas)
Component: General → DOM: Apps
Product: Marketplace → Core
Summary: Langpacks are not signed on Marketplace → Allow Langpacks to be signed and un-privileged
Version: Avenir → 40 Branch
The special case that Fabrice suggests in comment 5 is indeed the desired path: We'd prefer Langpacks to remain unprivileged, even if they do not contain code.
Flags: needinfo?(fbraun)
Comment on attachment 8587048 [details] [diff] [review] unprivileged-langpacks.patch I tested with user_pref("dom.apps.allow_unsigned_langpacks", false); and it works fine.
Attachment #8587048 - Flags: feedback?(stas) → feedback+
Attachment #8587048 - Flags: review?(ferjmoreno)
Comment on attachment 8587048 [details] [diff] [review] unprivileged-langpacks.patch Review of attachment 8587048 [details] [diff] [review]: ----------------------------------------------------------------- ::: dom/apps/Webapps.jsm @@ +3900,5 @@ > + allowUnsignedLangpack = > + Services.prefs.getBoolPref("dom.apps.allow_unsigned_langpacks"); > + } catch(e) {} > + let isLangPack = newManifest.role === "langpack" && > + (aIsSigned || allowUnsignedLangpack); nit: maybe we can avoid getting the pref if status <= maxStatus
Attachment #8587048 - Flags: review?(ferjmoreno) → review+
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Comment on attachment 8587048 [details] [diff] [review] unprivileged-langpacks.patch NOTE: Please see https://wiki.mozilla.org/Release_Management/B2G_Landing to better understand the B2G approval process and landings. [Approval Request Comment] Bug caused by (feature/regressing bug #): Mis-interpretation of requirement when doing the initial implementation. User impact if declined: Can't install langpacks from the marketplace. Testing completed: yes, manual with existing marketplace packages. Risk to taking this patch (and alternatives if risky): low risk, no alternative. String or UUID changes made by this patch: none.
Attachment #8587048 - Flags: approval-mozilla-b2g37?
Attachment #8587048 - Flags: approval-mozilla-b2g37? → approval-mozilla-b2g37+
Thanks, Fabrice, for fixing this so quickly!
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: