Browse Source

Check the correct variable before setting keys.

Georgi Chorbadzhiyski 12 years ago
parent
commit
e3d063244d
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      camd.c

+ 2
- 2
camd.c View File

@@ -70,10 +70,10 @@ void camd_set_cw(struct ts *ts, uint8_t *new_cw, int check_validity) {
70 70
 	c->key->ts = c->key->ts_keyset.tv_sec;
71 71
 	ts->cw_last_warn = c->key->ts;
72 72
 
73
-	if (!check_validity || memcmp(c->key->cw, invalid_cw, 8) != 0)
73
+	if (!check_validity || memcmp(new_cw, invalid_cw, 8) != 0)
74 74
 		csa_set_even_cw(c->key->csakey, new_cw);
75 75
 
76
-	if (!check_validity || memcmp(c->key->cw + 8, invalid_cw, 8) != 0)
76
+	if (!check_validity || memcmp(new_cw + 8, invalid_cw, 8) != 0)
77 77
 		csa_set_odd_cw(c->key->csakey, new_cw + 8);
78 78
 }
79 79
 

Loading…
Cancel
Save