|
@@ -34,6 +34,7 @@
|
34
|
34
|
#include "data.h"
|
35
|
35
|
#include "util.h"
|
36
|
36
|
#include "camd.h"
|
|
37
|
+#include "notify.h"
|
37
|
38
|
|
38
|
39
|
static int connect_to(struct in_addr ip, int port) {
|
39
|
40
|
ts_LOGf("CAM | Connecting to server %s:%d\n", inet_ntoa(ip), port);
|
|
@@ -164,7 +165,8 @@ READ:
|
164
|
165
|
|
165
|
166
|
int valid_cw = memcmp(c->key->cw, invalid_cw, 16) != 0;
|
166
|
167
|
if (!c->key->is_valid_cw && valid_cw) {
|
167
|
|
- ts_LOGf("CW | OK: Valid CW was received.\n");
|
|
168
|
+ ts_LOGf("CW | OK: Valid code word was received.\n");
|
|
169
|
+ notify(ts, "CODE_WORD_OK", "Valid code word was received.");
|
168
|
170
|
}
|
169
|
171
|
c->key->is_valid_cw = valid_cw;
|
170
|
172
|
|
|
@@ -255,8 +257,12 @@ static int camd35_send_ecm(struct ts *ts, uint16_t ca_id, uint16_t service_id, u
|
255
|
257
|
ret = camd35_recv_cw(ts);
|
256
|
258
|
if (ret < 48) {
|
257
|
259
|
ts->is_cw_error = 1;
|
258
|
|
- if (ts->key.ts && time(NULL) - ts->key.ts > KEY_VALID_TIME)
|
|
260
|
+ if (ts->key.ts && time(NULL) - ts->key.ts > KEY_VALID_TIME) {
|
|
261
|
+ if (c->key->is_valid_cw)
|
|
262
|
+ notify(ts, "NO_CODE_WORD", "No code word was set in %ld sec. Decryption is disabled.",
|
|
263
|
+ time(NULL) - ts->key.ts);
|
259
|
264
|
c->key->is_valid_cw = 0;
|
|
265
|
+ }
|
260
|
266
|
return 0;
|
261
|
267
|
}
|
262
|
268
|
|