Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support new elements, most importantly "Critical Security Update Version" #1151

Merged
merged 2 commits into from
Jun 27, 2024

Conversation

Jalle19
Copy link
Collaborator

@Jalle19 Jalle19 commented Jun 25, 2024

Should fix:

[30/12 20:01:53.761 AD2]: req element 49
[30/12 20:01:53.761 AD2]: element_get: invalid id
[30/12 20:01:53.761 AD2]: can not get element 49
[30/12 20:01:53.761 AD2]: cannot get element 49
[30/12 20:01:53.761 AD2]: cannot req data

@Delitants can you try your CAM again with this change?

Fixes #1029, fixes #1090, fixes #1134

@Jalle19 Jalle19 requested a review from catalinii June 25, 2024 07:22
@Delitants
Copy link

Should fix:

[30/12 20:01:53.761 AD2]: req element 49
[30/12 20:01:53.761 AD2]: element_get: invalid id
[30/12 20:01:53.761 AD2]: can not get element 49
[30/12 20:01:53.761 AD2]: cannot get element 49
[30/12 20:01:53.761 AD2]: cannot req data

@Delitants can you try your CAM again with this change?

Zero effect, same errors

[25/06 10:34:57.041 AD2]: RECV ciplus cc msg CAM2, session_num 6, tag 9f9007 len 40 dt_id 0
[25/06 10:34:57.041 AD2]: auth ok!
[25/06 10:34:57.041 AD2]: serial sac data req: 4
[25/06 10:34:57.041 AD2]: req element 49
[25/06 10:34:57.041 AD2]: element_get: invalid id
[25/06 10:34:57.041 AD2]: can not get element 49
[25/06 10:34:57.041 AD2]: cannot get element 49
[25/06 10:34:57.041 AD2]: cannot req data
[25/06 10:34:58.097 AD2]: READ TPDU: :

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 25, 2024

That is not possible, please make doubly sure you re-compile minisatip from the correct branch

@Delitants
Copy link

That is not possible, please make doubly sure you re-compile minisatip from the correct branch

I've literally went to my folder, applied the changes, did make clean, configure make and restarted. No effect:

[25/06 10:42:50.261 AD2]: RECV ciplus cc msg CAM2, session_num 6, tag 9f9007 len 40 dt_id 0
[25/06 10:42:50.261 AD2]: auth ok!
[25/06 10:42:50.261 AD2]: serial sac data req: 4
[25/06 10:42:50.261 AD2]: req element 49
[25/06 10:42:50.261 AD2]: element_get_buf: datatype 49 not valid
[25/06 10:42:50.261 AD2]: can not get element 49
[25/06 10:42:50.261 AD2]: cannot get element 49
[25/06 10:42:50.261 AD2]: cannot req data
[25/06 10:42:51.308 AD2]: READ TPDU: :
0000 00 01 80 02 01 80

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 25, 2024

This time you applied the change, not last time. There's a different message now.

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 25, 2024

Try removing the .bin file for your CAM from /var/cache/minisatip and try again

@Delitants
Copy link

Try removing the .bin file for your CAM from /var/cache/minisatip and try again

No changes:

[25/06 10:52:53.261 AD2]: RECV ciplus cc msg CAM2, session_num 6, tag 9f9007 len 40 dt_id 0
[25/06 10:52:53.261 AD2]: auth ok!
[25/06 10:52:53.261 AD2]: serial sac data req: 4
[25/06 10:52:53.261 AD2]: req element 49
[25/06 10:52:53.261 AD2]: element_get_buf: datatype 49 not valid
[25/06 10:52:53.261 AD2]: can not get element 49
[25/06 10:52:53.261 AD2]: cannot get element 49
[25/06 10:52:53.261 AD2]: cannot req data
[25/06 10:52:54.301 AD2]: READ TPDU: :
0000 00 01 80 02 01 80

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 25, 2024

@Delitants I pushed another commit, can you apply it and try again? I would remove the .bin file one more time just in case.

@Delitants
Copy link

@Delitants I pushed another commit, can you apply it and try again? I would remove the .bin file one more time just in case.

Thanks. Message has changed to:
[26/06 03:54:35.708 AD2]: RECV ciplus cc msg CAM2, session_num 6, tag 9f9007 len 88 dt_id 0
[26/06 03:54:35.708 AD2]: auth ok!
[26/06 03:54:35.708 AD2]: serial sac data req: 2
[26/06 03:54:35.708 AD2]: set element(dt_id) 6 dt_len = 8
[26/06 03:54:35.708 AD2]: element_set stored 6 with len 8
[26/06 03:54:35.708 AD2]: not need to be handled id 6
[26/06 03:54:35.708 AD2]: set element(dt_id) 12 dt_len = 32
[26/06 03:54:35.708 AD2]: element_set stored 12 with len 32
[26/06 03:54:35.708 AD2]: not need to be handled id 12
[26/06 03:54:35.708 AD2]: set element(dt_id) 28 dt_len = 1
[26/06 03:54:35.708 AD2]: element_set stored 28 with len 1
[26/06 03:54:35.708 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 0
[26/06 03:54:35.708 AD2]: received from CI+ CAM 2: KEY: ****
IV: *****

What are those keys it started to print in the log? Are they usable in oscam so I can get rid of this module and use the card alone?

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 26, 2024

No, those have been printed all this time. Can you post a complete log?

…ion"

Should fix:

[30/12 20:01:53.761 AD2]: req element 49
[30/12 20:01:53.761 AD2]: element_get: invalid id
[30/12 20:01:53.761 AD2]: can not get element 49
[30/12 20:01:53.761 AD2]: cannot get element 49
[30/12 20:01:53.761 AD2]: cannot req data
@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 26, 2024

Added improved support for operator profiles, hoping that it will shed some light on what needs to be done to make this CAM work. @Delitants please try this branch again at some point. Make sure you actually apply all the changes, I force pushed to the branch so you'll need to remove it and clone again.

Edit: dropped the operator profile related changes from this PR, let's focus on getting the key exchange working

@Jalle19 Jalle19 force-pushed the cip14-elements branch 2 times, most recently from fdcc5df to d853e7b Compare June 26, 2024 11:49
@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 26, 2024

I'm cautiously optimistic that the problem here is that we fail to send element 49 when the CAM requests it, after which it gives up and never sends any further elements. This means we don't get the odd register key later on when needed.

@Delitants
Copy link

No, those have been printed all this time. Can you post a complete log?

Please see the log with these changes. It did not fail in first 15 minutes yet.
minisatip2.log

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 26, 2024

Element is correctly sent to the CAM now:

$ cat minisatip2\(7\).log | grep 'stored 49\|element 49'
[26/06 21:16:24.634 AD2]: _element_set_ stored 49 with len 1
[26/06 21:16:32.829 AD2]: req element 49

and as if by magic, the CAM now sends the key for the other register roughly 10 seconds before a parity change:

$ cat minisatip2\(7\).log | grep descrambler_set_key
[26/06 21:16:30.485 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 0
[26/06 21:26:22.236 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 1

Fuck me, I think it works now 🙏

@Delitants
Copy link

Element is correctly sent to the CAM now:

$ cat minisatip2\(7\).log | grep 'stored 49\|element 49'
[26/06 21:16:24.634 AD2]: _element_set_ stored 49 with len 1
[26/06 21:16:32.829 AD2]: req element 49

and as if by magic, the CAM now sends the key for the other register roughly 10 seconds before a parity change:

$ cat minisatip2\(7\).log | grep descrambler_set_key
[26/06 21:16:30.485 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 0
[26/06 21:26:22.236 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 1

Fuck me, I think it works now 🙏

Awesome. Does that mean it will also resolve an issue that I needed to tune to a different channel after one month to re-activate the cam?

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 27, 2024

Probably not

@Jalle19 Jalle19 merged commit c10f8e9 into catalinii:master Jun 27, 2024
10 checks passed
@Jalle19 Jalle19 deleted the cip14-elements branch June 27, 2024 06:45
@Delitants
Copy link

Element is correctly sent to the CAM now:

$ cat minisatip2\(7\).log | grep 'stored 49\|element 49'
[26/06 21:16:24.634 AD2]: _element_set_ stored 49 with len 1
[26/06 21:16:32.829 AD2]: req element 49

and as if by magic, the CAM now sends the key for the other register roughly 10 seconds before a parity change:

$ cat minisatip2\(7\).log | grep descrambler_set_key
[26/06 21:16:30.485 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 0
[26/06 21:26:22.236 AD2]: === descrambler_set_key === adapter = CA2 key regiser (0-even, 1-odd) = 1

Fuck me, I think it works now 🙏

Not fixed. Fails during decoding, just with longer intervals now (hours instead of 5-10 minutes).
minisatip2.log.zip

@Jalle19
Copy link
Collaborator Author

Jalle19 commented Jun 28, 2024

Please use a version of minisatip that actually contains this fix
image

[27/06 21:52:47.252 main]: minisatip version 1.3.~11468f2, compiled on Jun 26 2024 23:53:05, with s2api version: 050B
[27/06 21:53:03.809 AD2]: req element 49
[27/06 21:53:03.809 AD2]: element_get: invalid id
[27/06 21:53:03.809 AD2]: can not get element 49
[27/06 21:53:03.809 AD2]: cannot get element 49
[27/06 21:53:03.809 AD2]: cannot req data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants