Commit Graph
65 Commits
Author SHA1 Message Date
Greg Stoll 8a8abef6da Bug 1913760 - parse custom data on the clipboard and send to DLP agent r=dlp-reviewers,handyman
Pass kCustomTypesMime data on the clipboard to the DLP agent.

Differential Revision: https://phabricator.services.mozilla.com/D219552
2024-08-26 04:38:35 +00:00
Butkovits Atila 2e692da502 Backed out changeset 8edda01e9950 (bug 1913760) for causing leaks. CLOSED TREE 2024-08-26 00:57:44 +03:00
Greg Stoll b329616790 Bug 1913760 - parse custom data on the clipboard and send to DLP agent r=dlp-reviewers,handyman
Pass kCustomTypesMime data on the clipboard to the DLP agent.

Differential Revision: https://phabricator.services.mozilla.com/D219552
2024-08-25 19:35:29 +00:00
Greg Stoll f5e9eb966c Bug 1912245 - don't shutdownhang with Content Analysis request active and default warn policy set r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D219910
2024-08-24 01:10:11 +00:00
Greg Stoll 8761987491 Bug 1912384 part 2 - don't show dialog for cached DLP results r=dlp-reviewers,handyman
For BLOCKED text, if we do two requests in quick succession, we will now
return a cached result for the second request. This patch avoids showing
the BLOCK dialog more than once. (also works for WARN)

Differential Revision: https://phabricator.services.mozilla.com/D219496
2024-08-22 13:15:36 +00:00
Greg Stoll 6393ed026d Bug 1912384 part 1 - cache DLP results for clipboard paste for a short time r=dlp-reviewers,handyman
This is a bit of a bandaid fix, but it's straightforward and
less brittle than trying to fix the various ways of getting
the clipboard contents.

I added a relatively short timeout to the cached data to
ensure we don't have to worry about DLP settings in the agent
changing or anything like that. In all the cases of double
calls I've seen, the calls come very very close to each other
in time.

Differential Revision: https://phabricator.services.mozilla.com/D219291
2024-08-22 13:15:36 +00:00
Tom Schuster 864c31e3e4 Bug 1809713 - Change nsIClipboard to use the ClipboardType enum. r=nika,geckoview-reviewers,win-reviewers,gstoll,m_kato
Differential Revision: https://phabricator.services.mozilla.com/D217807
2024-07-29 11:52:34 +00:00
Greg Stoll 453e8955fc Bug 1907466 - make some thread-safety changes for clipboard content analysis r=nika,dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D216608
2024-07-19 19:49:52 +00:00
Greg Stoll 66e9e557b9 Bug 1907303 - make Content Analysis check native clipboard format as well r=dlp-reviewers,handyman
- Check for native Windows clipboard format (kNativeHTMLMime) as well as plain text and HTML
- Make CheckClipboardContentAnalysisAsText() check for nsISupportsCString as well as nsISupportsString, as the kNativeHTMLMime format uses nsISupportsCString.
- Update test to correctly check pasting when copying from Firefox - if allowPaste is false, the paste should not happen. This test was wrong before this change and would have shown this problem if it had been correct.

Differential Revision: https://phabricator.services.mozilla.com/D216358
2024-07-16 18:57:53 +00:00
whale 55a9e5c0d4 Bug 1768758 - Add Windows-specific function getW() for getting wchar_t r=xpcom-reviewers,win-reviewers,gstoll,nika
`char16_t` and `wchar_t` are functionally the same on Windows. But logging statements do not handle `char16_t` very well, resulting in the need to static cast to `wchar_t`. For more info, see [[ https://bugzilla.mozilla.org/show_bug.cgi?id=1768758 | bug task ]]:

This diff introduces a Windows-specific function for getting strings as `wchar_t` and replaces previous workaround usages.

Differential Revision: https://phabricator.services.mozilla.com/D215869
2024-07-10 22:10:56 +00:00
Greg Stoll 525c80b4cc Bug 1899491 - correctly handle pasting an empty string for DLP r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D212961
2024-06-12 14:00:40 +00:00
Greg Stoll 1981579755 Bug 1899703, 1899971 - don't shutdownhang when quitting while DLP request is active r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D212474
2024-06-05 14:05:56 +00:00
Greg Stoll 9862f8ff3e Bug 1900390 - use regex_match for DLP regex's r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D212437
2024-06-04 23:43:12 +00:00
Brian Tsoi 332a273ac8 Bug 1883510 - Change Preferences to StaticPrefs in ContentAnalysis r=cmartin,gstoll,gcp
Differential Revision: https://phabricator.services.mozilla.com/D210095
2024-05-14 13:07:01 +00:00
Greg Stoll c71437e097 Bug 1883124 - add some gtests for nsIContentAnalysis r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D208007
2024-05-05 01:38:14 +00:00
Cristian Tuns f1da65b478 Backed out changeset b125cb63d120 (bug 1883124) for causing build bustages in TestContentAnalysis.cpp CLOSED TREE 2024-05-04 18:42:47 -04:00
Greg Stoll 10e33569b7 Bug 1883124 - add some gtests for nsIContentAnalysis r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D208007
2024-05-04 21:07:10 +00:00
Greg Stoll 263109d933 Bug 1879631 part 2 - also check clipboard contents in HTML format r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D207193
2024-05-02 13:41:52 +00:00
Greg Stoll e0d5e408d0 Bug 1880314 - add a default warn setting to Content Analysis r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D208039
2024-04-26 22:51:55 +00:00
Greg Stoll 4e868d690a Bug 1888713 - move Content Analysis clipboard code into the Content Analysis code r=dlp-reviewers,handyman
Got [[ https://treeherder.mozilla.org/jobs?repo=try&revision=e6b8fb3ed7af5b1bd665e376a5917d196327b2d2 | good try builds here ]].

Differential Revision: https://phabricator.services.mozilla.com/D207784
2024-04-22 18:29:52 +00:00
Greg Stoll 3625ba8618 Bug 1869868 part 2 - do not consult DLP when copy/pasting items in the same tab r=edgar,dlp-reviewers,credential-management-reviewers,handyman,sgalich
Differential Revision: https://phabricator.services.mozilla.com/D205744
2024-04-15 12:10:46 +00:00
Greg Stoll 76b517483b Bug 1884003 - make sure Content Analysis log messages aren't too big r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D206926
2024-04-10 20:44:25 +00:00
Greg Stoll 1a4633232d Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-10 00:15:47 +00:00
Greg Stoll 8a7617b316 Bug 1875481 - Part 2: Remove [infallible] from a few nsIContentAnalysis* IDL classes to allow mocking in tests r=handyman,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D200978
2024-04-10 00:15:46 +00:00
Stanca Serban 4c0f6b30c1 Backed out 3 changesets (bug 1875481) for basicWindowDotPrintTest related junit failures.
Backed out changeset cd024cb2768e (bug 1875481)
Backed out changeset 6b7be15cd017 (bug 1875481)
Backed out changeset d1da53c0673b (bug 1875481)
2024-04-09 05:56:47 +03:00
Greg Stoll 77cb63d2a3 Bug 1875481 - Part 3: Add content analysis support to printing operations r=handyman,spohl,fluent-reviewers,kpatenio,smaug,emilio
Differential Revision: https://phabricator.services.mozilla.com/D200979
2024-04-08 23:53:58 +00:00
Greg Stoll c16e80113c Bug 1875481 - Part 2: Remove [infallible] from a few nsIContentAnalysis* IDL classes to allow mocking in tests r=handyman,win-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D200978
2024-04-08 23:53:58 +00:00
Greg Stoll b2617fb32c Bug 1888291 - mark Content Analysis as not connected in about:support if agent connection has gone away r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D206031
2024-04-04 01:23:06 +00:00
Greg Stoll 4b6721833e Bug 1888259 - Show a notification when a Content Analysis request is denied for lack of an agent connection r=dlp-reviewers,fluent-reviewers,handyman
Note that this also covers the case when the connection initially succeeds but then the agent goes away - we hope to handle this better in bug 1888293. This also shows a message if the signature verification fails.

Differential Revision: https://phabricator.services.mozilla.com/D206024
2024-04-02 11:53:40 +00:00
Greg Stoll 3b30cfb6a3 Bug 1888498 - don't pass an empty string to Content Analysis r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D206053
2024-04-01 18:54:33 +00:00
Greg Stoll fae0adc604 Bug 1886023 - get URL through a smart pointer to avoid leaking r=dlp-reviewers,handyman
Differential Revision: https://phabricator.services.mozilla.com/D205497
2024-03-26 21:44:27 +00:00
Greg Stoll a5e79d0d52 Bug 1882606 - Add about:support information for Content Analysis r=dlp-reviewers,fluent-reviewers,bolsson,handyman
Differential Revision: https://phabricator.services.mozilla.com/D205121
2024-03-21 01:57:59 +00:00
Cristian Tuns 5975dea566 Backed out changeset 5218e0f5277b (bug 1882606) for causing bc failures in browser_Troubleshoot.js CLOSED TREE 2024-03-20 16:34:30 -04:00
Greg Stoll 07856f3a6f Bug 1882606 - Add about:support information for Content Analysis r=dlp-reviewers,fluent-reviewers,bolsson,handyman
Differential Revision: https://phabricator.services.mozilla.com/D205121
2024-03-20 19:21:56 +00:00
David P e1b995429b Bug 1879181: Allow skipping content analysis for requests that match url list r=gstoll,win-reviewers
Check the URLs in the request against the prefs
browser.contentanalysis.allow_url_regex_list and
browser.contentanalysis.deny_url_regex_list, which are space-separated
lists of ECMAscript regexs that match against ASCII-encoded URLs.

Differential Revision: https://phabricator.services.mozilla.com/D203508
2024-03-11 23:55:47 +00:00
Cosmin Sabou 29de9fa78b Backed out 3 changesets (bug 1879181) for causing gtest failures on ContentAnalysisTest.
Backed out changeset b2407a14159f (bug 1879181)
Backed out changeset 78303b2900e9 (bug 1879181)
Backed out changeset 25521d09c1de (bug 1879181)
2024-03-09 01:59:45 +02:00
Otto Länd 7c0ce0d03f Bug 1879181: apply code formatting via Lando
# ignore-this-changeset
2024-03-08 21:29:48 +00:00
David P e357268905 Bug 1879181: Allow skipping content analysis for requests that match url list r=gstoll,win-reviewers
Check the URLs in the request against the prefs
browser.contentanalysis.allow_url_regex_list and
browser.contentanalysis.deny_url_regex_list, which are space-separated
lists of ECMAscript regexs that match against ASCII-encoded URLs.

Differential Revision: https://phabricator.services.mozilla.com/D203508
2024-03-08 20:28:09 +00:00
David P 7c9f833074 Bug 1862066: Allow CA enabled when pref is set by enterprise policy or is set alongside command line arg r=gstoll,mkaply,fluent-reviewers,bolsson
Content analysis should not be turned on without an enterprise policy
requiring it or the -allow-content-analysis command-line argument is passed
(which is intended to be used for development).

Differential Revision: https://phabricator.services.mozilla.com/D203331
2024-03-08 18:15:28 +00:00
Greg Stoll 748f318387 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 17:50:07 +00:00
Cosmin Sabou 216033805e Backed out changeset 62ed755b7c5e (bug 1879152) for bc failures on browser_all_files_referenced. 2024-03-07 06:09:47 +02:00
Greg Stoll 0992e51892 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 03:19:09 +00:00
Sandor Molnar 78888fed61 Backed out changeset 5156f24f97bf (bug 1879152) for causing bc failures @ en-US/toolkit/contentanalysis/contentanalysis CLOSED TREE 2024-03-07 04:24:43 +02:00
Greg Stoll c681600c16 Bug 1879152 - Add confirmation dialog on quit when DLP requests are pending r=handyman,fluent-reviewers,bolsson
Differential Revision: https://phabricator.services.mozilla.com/D201154
2024-03-07 01:43:17 +00:00
Greg Stoll b077b9ffa5 Bug 1882596 - verify signature of content analysis client r=handyman
Differential Revision: https://phabricator.services.mozilla.com/D203476
2024-03-05 02:06:32 +00:00
David P 4ae4b747bc Bug 1882604: Make DLP agent timeout period a config setting r=gstoll
Differential Revision: https://phabricator.services.mozilla.com/D203306
2024-03-01 22:37:56 +00:00
Greg Stoll 3c0283579d Bug 1879182 - add a pref to make Content Analysis allow by default r=handyman
This will make DLP requests return Allow if the agent is not present or returns an error.

Differential Revision: https://phabricator.services.mozilla.com/D201277
2024-02-14 16:10:53 +00:00
Greg Stoll b2839267e7 Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-13 11:26:48 +00:00
Cristian Tuns 35a4843e35 Backed out changeset 9dfe3fe4ccc5 (bug 1871135) for causing mochitest failures in nsClipboardProxy.cpp CLOSED TREE 2024-02-12 12:04:41 -05:00
Greg Stoll 215d43e99f Bug 1871135 - Add content analysis support to clipboard operations r=edgar,nika,masayuki,devtools-reviewers
When content analysis is on, pastes will be checked by the CA
agent while tab input is blocked. The synchronous nsIClipboard.getData()
method must block until the analysis result is received, so this
requires doing a SpinEventLoopUntil.

Differential Revision: https://phabricator.services.mozilla.com/D196997
2024-02-12 16:05:06 +00:00