devine-dl/pywidevine

Do we know anything more about the new field oemcrypto_core_message in OEMCrypto v16

Closed this issue · 6 comments

Could there be more specific information provided in the proto comment:

// The core message is the simple serialization of fields used by OEMCrypto.
// This field was introduced in OEMCrypto API v16.

Or perhaps a reference to where we could learn more about what this is?

I've been experimenting and it appears that signature verification fails in cases where oemcrypto_core_message is provided in the license request. The license response includes an altered (much longer) oemcrypto_core_message that I suspect is being included somehow in decrypting the session_key which is why the message signature verification fails. Thoughts?

Actually, I was able to verify that decrypting the session key seems fine as the content keys themselves still decrypt correctly. So perhaps the oemcrypto_core_message is used in signature generation directly?

I don't think it's used in relation to the signature field at all. But I do believe it's proto-serialized data of some OEMCrypto values. It looks like random garbage data as it has not yet been fuzzed (as in, no proto schema for it has been made).

Signature checks should not be failing for you. Make sure you are on the very latest version as I did fix an issue related to signature checks and it could just be that.

Hi, turns out I was wrong! It is! It's now also fixed, 00e72c0

Thanks for reporting. As for information on it I don't have a clue what it's used for. Looks like it has some header information at the start, possibly magic, then a LOT of data. I'd imagine the majority of it is either encrypted, another signature, or some form of a public key. But that's just assumptions and guesses.

The data does not seem to be any form of a valid protobuffer. Based on the little info we have, it may simply just be a concatenation of various data fields of the OEM Crypto API.

In some further data I've found, it refers to the document Widevine Core Message Serialization for more information. I don't think I have this nor can I find anything about it.

Has anyone ever managed to figure out what this is?

I've been looking into this project which includes info on OEMCrypto function calls, but I don't have an Android to try it with.

Example from a license request:
00 00 00 01 00 00 00 14 00 05 00 10 28 a8 d7 b9 03 7e b7 93
{uint32; 1 for request, 2 for response} {uint32; length of entire string} 00 05 00 10 {8-byte nonce}

Its corresponding response:
00 00 00 02 00 00 01 c8 00 05 00 10 28 a8 d7 b9 03 7e b7 93 00 00 00 50 00 00 00 10 00 00 00 62 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 51 80 00 00 00 00 00 01 51 80 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 a8 00 00 00 10 00 00 00 ba 00 00 00 10 00 00 00 cc 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 00 00 00 00 10 00 00 01 12 00 00 00 10 00 00 01 24 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 58 00 00 00 10 00 00 01 6a 00 00 00 10 00 00 01 7c 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 b3 00 00 00 10 00 00 01 c5 00 00 00 10 00 00 01 d7 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 0b 00 00 00 10 00 00 02 1d 00 00 00 10 00 00 02 2f 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 63 00 00 00 10 00 00 02 75 00 00 00 10 00 00 02 87 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 bb 00 00 00 10 00 00 02 cd 00 00 00 10 00 00 02 df 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 03 13 00 00 00 10 00 00 03 25 00 00 00 10 00 00 03 37 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 ca df 6b 58 bd 1d 6b 08 98 c5 c9 d6 81 b9 48 99 51 c0 7e 12 e0 32 ea db be af 5e 36 4e 3a 2d 2f
{uint32; 1 for request, 2 for response} {uint32; length of entire string} 00 05 00 10 {the same 8-byte nonce from the request} 00 00 00 50 00 00 00 10 00 00 00 62 00 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 51 80 00 00 00 00 00 01 51 80 00 00 00 00 00 00 00 00 00 00 00 08 00 00 00 a8 00 00 00 10 00 00 00 ba 00 00 00 10 00 00 00 cc 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 00 00 00 00 10 00 00 01 12 00 00 00 10 00 00 01 24 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 58 00 00 00 10 00 00 01 6a 00 00 00 10 00 00 01 7c 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 01 b3 00 00 00 10 00 00 01 c5 00 00 00 10 00 00 01 d7 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 0b 00 00 00 10 00 00 02 1d 00 00 00 10 00 00 02 2f 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 63 00 00 00 10 00 00 02 75 00 00 00 10 00 00 02 87 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 02 bb 00 00 00 10 00 00 02 cd 00 00 00 10 00 00 02 df 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 00 00 03 13 00 00 00 10 00 00 03 25 00 00 00 10 00 00 03 37 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 e8 00 00 00 10 {seems like a sha256 hash, possibly a hmac}