i-rinat / freshplayerplugin

ppapi2npapi compatibility layer
MIT License
727 stars 52 forks source link

Chromebook's flash used by firefox works on test but fails in real life #377

Open Enerccio opened 6 years ago

Enerccio commented 6 years ago

I have extracted and installed pepper flash from chrome os backup image. When I try http://drmtest2.adobe.com:8080/SVP/SampleVideoPlayer_FP.html# with http://drmtest2.adobe.com:8080/Content/anonymous.f4v everything works just fine and train video plays.

Here is log:

   Starts to get video metadata at Mon Jul 16 13:00:55 GMT+0200 2018
   DRMContentData received on Mon Jul 16 13:00:55 GMT+0200 2018
   authenticationMethod = anonymous
   ServerURL = http://drmtest2.adobe.com:8080
   license ID = 43345AEF-52FF-3F20-90FF-ABDC98A2E3E4
   Local voucher...
   Load local voucher complete event received on Mon Jul 16 13:00:56 GMT+0200 2018
   voucher not found in local voucher store.
   DownloadVoucherComplete event received on Mon Jul 16 13:00:56 GMT+0200 2018

   customPolicies : 
   policies.Slippery = Slope_Let's_Fall_Down_It
   policies.playbackMode = all
   policies.Giant = SuperDuperPanda
   policies.Sound of one hand clapping = 
   policies.DRMTEST2 = 
   startDate = null
   endDate = null
   offlineLeaseStartDate = Mon Jul 16 13:00:56 GMT+0200 2018
   offlineLeaseEndDate = Mon Jul 16 14:00:56 GMT+0200 2018
   playbackTimeWindow = null 
   -------------
   Start to play content on Mon Jul 16 13:00:56 GMT+0200 2018
   -------------

   DRMStatus event received on Mon Jul 16 13:00:57 GMT+0200 2018

   customPolicies : 
   policies.Slippery = Slope_Let's_Fall_Down_It
   policies.playbackMode = all
   policies.Giant = SuperDuperPanda
   policies.Sound of one hand clapping = 
   policies.DRMTEST2 = 
   startDate = null
   endDate = null
   offlineLeaseStartDate = Mon Jul 16 13:00:56 GMT+0200 2018
   offlineLeaseEndDate = Mon Jul 16 14:00:56 GMT+0200 2018
   playbackTimeWindow = null 

But when I try to play real life web service (wwe network) it seems like it wants to start but then it fails. In console, firefox will output:

[Parent 21898, Gecko_IOThread] WARNING: pipe error (142): Connection reset by peer: file /build/firefox/src/mozilla-unified/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353
NOT SANDBOXED
[fresh 22086] not implemented: PPB_OpenGLES2VertexArrayObject;1.0
[fresh 22086] not implemented: PPB_OpenGLES2DrawBuffers(Dev);1.0
[fresh 22086] not implemented: PPB_BrokerTrusted;0.3
[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

[fresh 22086] ppb_flash_drm_get_device_id, creating salt file
GlobalStateStoreSPIImpl::storeIndivResults
GlobalStateStoreSPIImpl::_init
GlobalStateStoreSPIImpl::_checkDeviceBinding
GlobalStateStoreSPIImpl::getMachinePrivateKey
GlobalStateStoreSPIImpl::getMachinePrivateKey
GlobalStateStoreSPIImpl::getMachinePrivateKey
[fresh 22086] not implemented: PPB_BrokerTrusted;0.3
[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

and


".ARNING:flash/platform/pepper/pep_url_request_info.cpp(219)] Missing colon in HTTP header line "
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "User-Agent".
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "Connection".

over and over.

Enerccio commented 6 years ago

Maybe it needs not implemented: PPB_BrokerTrusted;0.3?

i-rinat commented 6 years ago

Missing colon in HTTP header line Illegal HTTP header field: "User-Agent".

Those messages look mysterious. I remember similar messages, but that issue was fixed years ago. What version of freshplayerplugin do you use? Did you try the latest one from the repo?

Is there any other site with similar error, preferably without required ~regustrations~ registration?

Maybe it needs not implemented: PPB_BrokerTrusted;0.3?

That's unlikely. It's somehow related to privilege separation and sandboxing. (Also, I have no idea how to implement that from documentation only. It's to vague.)

Enerccio commented 6 years ago

This is with latest git build built from aur (arch linux user repository): https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=freshplayerplugin-git

Still not working and same set of messages.

[Parent 13164, Gecko_IOThread] WARNING: pipe error (145): Connection reset by peer: file /build/firefox/src/mozilla-unified/ipc/chromium/src/chrome/common/ipc_channel_posix.cc, line 353
NOT SANDBOXED
[fresh 13317] not implemented: PPB_OpenGLES2VertexArrayObject;1.0
[fresh 13317] not implemented: PPB_OpenGLES2DrawBuffers(Dev);1.0
[fresh 13317] not implemented: PPB_BrokerTrusted;0.3
[fresh 13317] not implemented: PPB_BrokerTrusted;0.3
[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

[ERROR:flash/platform/pepper/pep_shader_factory.cpp(408)] Compilation failed: 0:1(1): error: syntax error, unexpected $end

This shows when loading video.

[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "User-Agent".
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "Connection".
".ARNING:flash/platform/pepper/pep_url_request_info.cpp(219)] Missing colon in HTTP header line "
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "User-Agent".
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "Connection".
".ARNING:flash/platform/pepper/pep_url_request_info.cpp(219)] Missing colon in HTTP header line "
[WARNING:flash/platform/pepper/pep_url_request_info.cpp(195)] Illegal HTTP header field: "User-Agent".
i-rinat commented 6 years ago

Got a (demo) subscription for WWE. And indeed, video doesn't play. For some reason Adobe's DRM test page fails too, but that may be some temporary issue at their site, since one of the responses is something like 500, internal server error.

I see the same messages (Illegal HTTP header field: "User-Agent"), which are actually looking strange. If I turn on tracing in freshplayerplugin, string "User-Agent" is nowhere to be seen. It's unlikely that remote server reply will contain "User-Agent" field, so it's not failure to parse something I pass to the Flash plugin. It's something inside. There are number of instances of the string "User-Agent" in the Flash binary. When I modify one of them, the error message changes with it. So it really originates from inside Flash binary. Unfortunately, I don't understand, what causes it.

Enerccio commented 6 years ago

Hmm so it is specifically related how WWE network calls flash?

i-rinat commented 6 years ago

so it is specifically related how WWE network calls flash?

It looks like so from the first glance. And it's more like something internal in Flash, not the application developer's code. Perhaps, freshplayerplugin calls Flash in a weird way, and that triggers unexpected path inside Flash code. I just don't know what went wrong.

i-rinat commented 6 years ago

Well, I think, I know what causes the bug.

NPAPI does not allow any custom headers for GET requests. Client can only choose an URL to retrieve. Every other headers such as referrer, user agent, and cookies, are provided by the browser. However, Flash want to set own header fields, and PPAPI was designed with that requirement in mind. I saw in tracing information that Flash tries to set custom Cookie header for a request, but doesn't work in freshplayerplugin. That custom cookie is ignored. And that most probably is the root cause.

NPAPI Flash already uses own network client. Looks like doing the same is the only option to fix this particular issue. There is no way to play by the rules of NPAPI.

Enerccio commented 6 years ago

So you will be able to fix it?

i-rinat commented 6 years ago

Yeah, eventually.