colon++;
if (strncmp(buf, "X-DTLS-", 7) &&
- strncmp(buf, "X-CSTP-", 7))
+ strncmp(buf, "X-CSTP-", 7) &&
+ strncmp(buf, "X-DTLS12-", 9))
continue;
new_option = malloc(sizeof(*new_option));
else
vpn_progress(vpninfo, PRG_DEBUG, "%s: %s\n", buf, colon);
- if (!strncmp(buf, "X-DTLS-", 7)) {
+ if (((i = 7) && !strncmp(buf, "X-DTLS-", 7)) ||
+ ((i = 9) && !strncmp(buf, "X-DTLS12-", 9))) {
*next_dtls_option = new_option;
next_dtls_option = &new_option->next;
- if (!strcmp(buf + 7, "MTU")) {
+ if (!strcmp(buf + i, "MTU")) {
int dtlsmtu = atol(colon);
if (dtlsmtu > mtu)
mtu = dtlsmtu;
- } else if (!strcmp(buf + 7, "Session-ID")) {
+ } else if (!strcmp(buf + i, "Session-ID")) {
int dtls_sessid_changed = 0;
int vsize;
if (dtls_sessid_changed && vpninfo->dtls_state > DTLS_SLEEPING)
vpninfo->dtls_need_reconnect = 1;
- } else if (!strcmp(buf + 7, "App-ID")) {
+ } else if (!strcmp(buf + i, "App-ID")) {
int dtls_appid_changed = 0;
int vsize;
if (dtls_appid_changed && vpninfo->dtls_state > DTLS_SLEEPING)
vpninfo->dtls_need_reconnect = 1;
- } else if (!strcmp(buf + 7, "Content-Encoding")) {
+ } else if (!strcmp(buf + i, "Content-Encoding")) {
if (!strcmp(colon, "lzs"))
vpninfo->dtls_compr = COMPR_LZS;
else if (!strcmp(colon, "oc-lz4"))
colon);
return -EINVAL;
}
+ } else if (!strcmp(buf + i, "CipherSuite")) {
+ /* Remember if it came from a 'X-DTLS12-CipherSuite:' header */
+ vpninfo->cisco_dtls12 = (i == 9);
+ vpninfo->dtls_cipher = strdup(colon);
}
continue;
}
_("DTLS option %s : %s\n"),
dtls_opt->option, dtls_opt->value);
- if (!strcmp(dtls_opt->option + 7, "Port")) {
+ if (!strcmp(dtls_opt->option, "X-DTLS-Port")) {
dtls_port = atol(dtls_opt->value);
- } else if (!strcmp(dtls_opt->option + 7, "Keepalive")) {
+ } else if (!strcmp(dtls_opt->option, "X-DTLS-Keepalive")) {
vpninfo->dtls_times.keepalive = atol(dtls_opt->value);
- } else if (!strcmp(dtls_opt->option + 7, "DPD")) {
+ } else if (!strcmp(dtls_opt->option, "X-DTLS-DPD")) {
int j = atol(dtls_opt->value);
if (j && (!vpninfo->dtls_times.dpd || j < vpninfo->dtls_times.dpd))
vpninfo->dtls_times.dpd = j;
- } else if (!strcmp(dtls_opt->option + 7, "Rekey-Method")) {
+ } else if (!strcmp(dtls_opt->option, "X-DTLS-Rekey-Method")) {
if (!strcmp(dtls_opt->value, "new-tunnel"))
vpninfo->dtls_times.rekey_method = REKEY_TUNNEL;
else if (!strcmp(dtls_opt->value, "ssl"))
vpninfo->dtls_times.rekey_method = REKEY_SSL;
else
vpninfo->dtls_times.rekey_method = REKEY_NONE;
- } else if (!strcmp(dtls_opt->option + 7, "Rekey-Time")) {
+ } else if (!strcmp(dtls_opt->option, "X-DTLS-Rekey-Time")) {
vpninfo->dtls_times.rekey = atol(dtls_opt->value);
- } else if (!strcmp(dtls_opt->option + 7, "CipherSuite")) {
- vpninfo->dtls_cipher = strdup(dtls_opt->value);
}
dtls_opt = dtls_opt->next;