[EME] InitDataRegistry should use base64url encoding and decoding for keyids
https://bugs.webkit.org/show_bug.cgi?id=167592
Reviewed by Jer Noble.
Source/WebCore:
In InitDataRegistry, WTF::base64URLEncode() and WTF::base64URLDecode() should
be used to encode and decode the 'keyids' initialization data format, as
required by the relevant specification.
https://w3c.github.io/encrypted-media/format-registry/initdata/keyids.html#format
Relevant test case was added to media/encrypted-media/mock-MediaKeySession-generateRequest.html.
* Modules/encryptedmedia/InitDataRegistry.cpp:
(WebCore::extractKeyIDsKeyids):
(WebCore::sanitizeKeyids):
LayoutTests:
* media/encrypted-media/mock-MediaKeySession-generateRequest-expected.txt:
* media/encrypted-media/mock-MediaKeySession-generateRequest.html: Include a test case
that passes an init data JSON to generateRequest() that fails to decode when using the
plain base64 decoding algorithm. The test passes when base64url encoding and decoding
are used in InitDataRegistry.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@211429
268f45cc-cd09-0410-ab3c-
d52691b4dbfc