char *cmlocred = NULL;
char *cmremred = NULL;
+int seqcheck = 0;
int timeout = 100; /* ms */
int stop = 0;
return 0;
}
int seqtx = MOREP_Send (cm->txred, 0x00, out, out_len);
+ VERBOSE (ulvpn, DEBUG, PRINTF ("send %d bytes to MOREP CM red\n", out_len));
/* get encrypted message and check it */
uint8_t in[MAXPAYLOAD] = {0};
uint8_t msgtype = 0;
int in_len = 0;
int seqrx = MOREP_Receive_timeout (cm->rxblack, &msgtype, in, &in_len, timeout);
- if ((msgtype != 0x01) || (in_len != out_len + 16) || (seqtx != seqrx)) {
+ VERBOSE (ulvpn, DEBUG, PRINTF ("received %d bytes from MOREP CM black\n", in_len));
+ if ((msgtype != 0x01) || (in_len != out_len + 16) || ((seqcheck) && (seqtx != seqrx))) {
VERBOSE (ulvpn, WARNING, PRINTF ("non-coherent encrypted message\n"));
return 0;
}
return 0;
}
int seqtx = MOREP_Send (cm->txblack, 0x02, out, out_len);
+ VERBOSE (ulvpn, DEBUG, PRINTF ("send %d bytes to MOREP CM black\n", out_len));
/* get clear message and check it */
uint8_t in[MAXPAYLOAD] = {0};
uint8_t msgtype = 0;
int in_len = 0;
int seqrx = MOREP_Receive_timeout (cm->rxred, &msgtype, in, &in_len, timeout);
- if ((msgtype != 0x03) || (in_len != out_len - 16) || (seqtx != seqrx)) {
+ VERBOSE (ulvpn, DEBUG, PRINTF ("received %d bytes from MOREP CM red\n", in_len));
+ if ((msgtype != 0x03) || (in_len != out_len - 16) || ((seqcheck) && (seqtx != seqrx))) {
VERBOSE (ulvpn, WARNING, PRINTF ("non-coherent decrypted message\n"));
return 0;
}
return 1;
}
CHANGE_VERBOSE_LEVEL (mapec, atoi (arg));
+ CHANGE_VERBOSE_LEVEL (morep, atoi (arg));
break;
case 'x':
arg = (arg[2]) ? arg + 2 : (--argc > 0) ? *(++argv) : NULL;