Commit Graph
24 Commits
Author SHA1 Message Date
Jim Chen dc092a684f Bug 1393128 - 4. Add window to all Prompt usages; r=snorp
Add a `window` parameter to all Prompt.jsm usages, so the prompt will
appear in the correct window. This includes HelperAppDialog.js, which
was preventing the download chooser dialog from appearing in a custom
tab window.

The patch also moves `getActiveDispatcher` from GeckoViewPermission to
GeckoViewUtils, and makes several improvements to `getChromeWindow` and
`getDispatcherForWindow`. Prompt.jsm now uses the active
WindowDispatcher in the fallback scenario where we don't have a window.

MozReview-Commit-ID: KpAFMCZzQZp
2017-09-18 15:45:34 -04:00
Dan Banner b08cb5b49e Bug 1385815 - Enable brace-style and quotes ESLint rules for mobile/android. r=sebastian
MozReview-Commit-ID: 5IFF4IPpPVY
2017-08-01 16:43:56 +01:00
Nathan Froyd 8335babfc9 Bug 1372670 - part 3 - add spinEventLoopUntil to nsIThreadManager; r=erahm,florian 2017-06-21 12:59:28 -04:00
David Keeler 0cad676aa4 bug 857627 - 2/4: remove nsIX509Cert.nickname r=Cykesiopka,jcj
In general, any code that was using nsIX509Cert.nickname should be able to use
the attribute displayName (if using nickname for display purposes) or the
attribute dbKey (if using nickname as a unique identifier for a certificate).

MozReview-Commit-ID: G9CfMJDfLqe
2016-11-18 13:12:29 -08:00
Cykesiopka 9016fedb8f Bug 1281665 - Change nsIClientAuthDialogs.chooseCertificate() to use hostname instead of CN. r=keeler
chooseCertificate() currently uses a concatenation of the Common Name of the
server cert and the port of the server to allow the user to identify the server
requesting client authentication. Unfortunately, this approach is flawed, since
it doesn't take into account things like SAN entries, which might be very
different from the CN.

Using the hostname instead avoids this problem.

MozReview-Commit-ID: 6XjGCknWNi9
2016-07-26 20:16:58 +08:00
Cykesiopka 173140b9e8 Bug 1281661 - Ensure input to NSSDialogService prompt messages are HTML escaped to avoid HTML injection. r=kats,keeler
As of the writing of this patch, NSSDialogService pops up a prompter on
Android as follows (assuming at least one label is requested):
1. NSSDialogService.js calls Prompt.jsm methods and eventually requests the
   prompt be displayed.
2. Prompt.jsm sends a messages to the Java side.
3. The Java side receives the message and eventually calls
   org.mozilla.gecko.prompts.PromptInput.LabelInput.getView().
4. LabelInput.getView() calls android.text.Html.fromHtml().

At no point is any HTML injection prevention done, so in theory NSSDialogService
could be an injection vector.

In practice, it appears that fromHtml() doesn't actually allow anything malicious
to be done. This patch introduces HTML escaping at the NSSDialogService
level just to be safe.

MozReview-Commit-ID: LhHuZKSqx01
2016-06-29 18:48:49 -07:00
Cykesiopka 2a32e054e0 Bug 307081 - Make nsIClientAuthDialogs::ChooseCertificate() pass an nsIArray of nsIX509Certs, not strings. r=kats,keeler
This provides implementations of ChooseCertificate() with more flexibility, and
allows callers of ChooseCertificate() to be less complex.

A portion of this work involves reimplementing
nsNSSCertificate::FormatUIStrings() in JS and improving UI strings for l10n.

MozReview-Commit-ID: CE7Uc2ntwmZ
2016-06-24 00:12:16 -07:00
Cykesiopka 1493f80bcb Bug 307081 - Clean up nsIClientAuthDialogs.idl and implementations. r=kats,keeler
This fixes the following in the IDL:
1. Misleading or unclear parameter names in the IDL. |cn| in practice is the
   concatenation of the CN of the server cert and the port of the server, and
   |issuer| is the Organization of the issuer cert of the server cert.
2. Use of the |wstring| type. |AString| is generally preferred, and has the
   benefit of letting implementations skip null checks due to the use of
   references.
3. Using an explicit |canceled| outparam instead of just setting a return type.
   There is no need for the outparam if the return type can be used.
4. Using |long| (int32_t) for |selectedIndex|. |unsigned long| (uint32_t) is
   more logical, and paves the way for future changes.

This fixes the following in the Android implementation:
1. Lack of checks to ensure the QueryInterface() call succeeded. In practice,
   the call will always succeed, but it's good practice to check anyways.
2. Setting a variable to an nsIPrefService instance initially, then later
   setting it to a pref branch instance later on. This is confusing and
   unnecessary.

This fixes the following in the desktop implementation:
1. Lack of null pointer checking.
2. Trying to get a parent window ref off a context that doesn't actually support
   doing so.
3. Setting a variable to an nsIPrefService instance initially, then later
   setting it to a pref branch instance later on. This is confusing and
   unnecessary.
4. Abusal of the CAPS bundle.
5. Unnecessary variables.
6. Variables declared far away from where they are used.
7. Variable shadowing.
8. Style issues.
9. Lack of documentation.

This also fixes the following:
1. Lack of localisation notes.

MozReview-Commit-ID: FTc6XecJd6h
2016-06-24 00:12:11 -07:00
Cykesiopka 17947b69ec Bug 307081 - Fix buggy Android implementation of nsIClientAuthDialogs::ChooseCertificate(). r=kats
This fixes two issues:
1. Passing a literal 1 as the |length| argument to formatStringFromName(). This
   is obviously incorrect and should instead be the length of the given arg
   list.
2. Directly setting the |selectedIndex| outparam to a number. XPIDL outparams
   on the JS side are actually objects that wrap the true outparam value, which
   must be accessed via |.value|.

MozReview-Commit-ID: BJObQfcV5G7
2016-06-24 00:12:01 -07:00
Cykesiopka e4a36ce08f Bug 1251009 - Remove unused nsICertificateDialogs.notifyCACertExists() method. r=keeler, r=mfinkle
MozReview-Commit-ID: 5CFAsy5e1Cl
2016-03-16 12:48:59 -07:00
David Keeler 81103d4e7f bug 1076329 - fix NSSDialogService to properly inspect checkbox state in confirmDownloadCACert r=mfinkle 2015-02-09 15:09:06 -08:00
Mark Goodwin 34daf67181 Bug 1081711 - Ensure 'remember this decision' works for client certificates. r=wjohnston 2014-10-22 13:18:00 +02:00
Mark Finkle 3d74530c83 Bug 989577 - Lazy load Prompt.jsm everywhere r=wesj 2014-07-29 15:48:40 -04:00
Cykesiopka d8dda275f8 Bug 622332 - Show cert SHA-256 fingerprint and remove MD5 fingerprint. r=keeler 2014-05-22 00:52:00 +02:00
YFdyh000 1cd7015eea Bug 995528 - Certificate viewer describes not-valid-before date as issue date. r=honzab, ui-r=philipp 2014-04-21 10:58:04 -04:00
Kartikaya Gupta f60729736a Bug 921477 - Fix typo causing certificate usage failure. rs=wesj 2013-09-27 14:06:14 -04:00
Brian Smith 54f7a989ea Bug 867465: Remove the "Revocation Lists" feature, r=cviecco, r=mattn 2013-06-02 23:37:47 -07:00
Brian Smith fa7fd1ab9d Backout 308e3cd73c5f, cc9980cb3db2, f5591bedc40e due to build failure 2013-06-22 16:45:47 -07:00
Brian Smith 9bd665a789 Bug 867465: Remove the Revocation Lists feature, r=cviecco, r=mattn 2013-06-02 23:37:47 -07:00
Wes Johnston 515afaf34a Bug 878848 - Use Prompt.jsm for NSS prompts. r=kats 2013-06-12 09:14:58 -07:00
Aaron Moses 076443979f Bug 845375 - Implement the nsIClientAuthDialogs interface for android. r=kats 2013-03-07 18:08:03 +00:00
Kartikaya Gupta dcfe7ba175 Bug 774964 - Implement the getPKCS12FilePassword dialog in native fennec. r=mfinkle 2013-02-27 00:08:47 -05:00
Brian Nicholson a2be573f34 Bug 837848 - Remove gecko property from handleGeckoMessage calls. r=mfinkle 2013-02-04 13:22:30 -08:00
Kartikaya Gupta 44a788b12f Bug 807606 - Add a native UI implementation of the NSS dialog service in Fennec. r=mfinkle 2013-01-24 15:41:35 -05:00