/* * Handle the request to release a hold from the OpenVPN management interface */ void OnPassword(connection_t *c, char *msg) { if (strncmp(msg, "Verification Failed", 19) == 0) return; if (strstr(msg, "'Auth'")) { LocalizedDialogBoxParam(ID_DLG_AUTH, UserAuthDialogFunc, (LPARAM) c); } else if (strstr(msg, "'Private Key'")) { LocalizedDialogBoxParam(ID_DLG_PASSPHRASE, PrivKeyPassDialogFunc, (LPARAM) c); } else if (strstr(msg, "'HTTP Proxy'")) { QueryProxyAuth(c, http); } else if (strstr(msg, "'SOCKS Proxy'")) { QueryProxyAuth(c, socks); } }
/* * Handle the request to release a hold from the OpenVPN management interface */ void OnPassword(connection_t *c, char *msg) { if (strncmp(msg, "Verification Failed", 19) == 0) return; if (strstr(msg, "'Auth'")) { char* chstr = strstr(msg, "SC:"); auth_param_t *param = (auth_param_t *) malloc(sizeof(auth_param_t)); param->c = c; if (chstr) { param->challenge_echo = *(chstr + 3) != '0'; param->challenge_str = strdup(chstr + 5); LocalizedDialogBoxParam(ID_DLG_AUTH_CHALLENGE, UserAuthDialogFunc, (LPARAM) param); } else { param->challenge_echo = 0; param->challenge_str = NULL; LocalizedDialogBoxParam(ID_DLG_AUTH, UserAuthDialogFunc, (LPARAM) param); } } else if (strstr(msg, "'Private Key'")) { LocalizedDialogBoxParam(ID_DLG_PASSPHRASE, PrivKeyPassDialogFunc, (LPARAM) c); } else if (strstr(msg, "'HTTP Proxy'")) { QueryProxyAuth(c, http); } else if (strstr(msg, "'SOCKS Proxy'")) { QueryProxyAuth(c, socks); } }