diff --git a/src/Cedar/Protocol.c b/src/Cedar/Protocol.c index 7e552d94..9cf11dff 100644 --- a/src/Cedar/Protocol.c +++ b/src/Cedar/Protocol.c @@ -7298,6 +7298,8 @@ PACK *PackLoginWithPlainPassword(char *hubname, char *username, void *plain_pass PACK *PackLoginWithOpenVPNCertificate(char *hubname, char *username, X *x) { PACK *p; + char cn_username[128]; + BUF *cert_buf = NULL; // Validate arguments if (hubname == NULL || username == NULL || x == NULL) { @@ -7308,7 +7310,6 @@ PACK *PackLoginWithOpenVPNCertificate(char *hubname, char *username, X *x) PackAddStr(p, "method", "login"); PackAddStr(p, "hubname", hubname); - char cn_username[128]; if (IsEmptyStr(username)) { if (x->subject_name == NULL) @@ -7326,7 +7327,7 @@ PACK *PackLoginWithOpenVPNCertificate(char *hubname, char *username, X *x) PackAddInt(p, "authtype", AUTHTYPE_OPENVPN_CERT); - BUF *cert_buf = XToBuf(x, false); + cert_buf = XToBuf(x, false); PackAddBuf(p, "cert", cert_buf); FreeBuf(cert_buf); diff --git a/src/Cedar/SM.c b/src/Cedar/SM.c index f5a6395b..d94df78b 100644 --- a/src/Cedar/SM.c +++ b/src/Cedar/SM.c @@ -18365,6 +18365,7 @@ void SmServerDlgInit(HWND hWnd, SM_SERVER *p) void SmServerDlgRefresh(HWND hWnd, SM_SERVER *p) { RPC_ENUM_HUB t; + RPC_LISTENER_LIST t2; DDNS_CLIENT_STATUS st; RPC_AZURE_STATUS sta; UINT i; @@ -18452,35 +18453,34 @@ void SmServerDlgRefresh(HWND hWnd, SM_SERVER *p) } // Listener list update - RPC_LISTENER_LIST t; - Zero(&t, sizeof(RPC_LISTENER_LIST)); - if (CALL(hWnd, ScEnumListener(p->Rpc, &t))) + Zero(&t2, sizeof(RPC_LISTENER_LIST)); + if (CALL(hWnd, ScEnumListener(p->Rpc, &t2))) { LVB *b = LvInsertStart(); - for (i = 0;i < t.NumPort;i++) + for (i = 0;i < t2.NumPort;i++) { wchar_t tmp[MAX_SIZE]; wchar_t *status; UINT icon; - UniFormat(tmp, sizeof(tmp), _UU("CM_LISTENER_TCP_PORT"), t.Ports[i]); + UniFormat(tmp, sizeof(tmp), _UU("CM_LISTENER_TCP_PORT"), t2.Ports[i]); status = _UU("CM_LISTENER_ONLINE"); icon = ICO_PROTOCOL; - if (t.Errors[i]) + if (t2.Errors[i]) { status = _UU("CM_LISTENER_ERROR"); icon = ICO_PROTOCOL_X; } - else if (t.Enables[i] == false) + else if (t2.Enables[i] == false) { status = _UU("CM_LISTENER_OFFLINE"); icon = ICO_PROTOCOL_OFFLINE; } - LvInsertAdd(b, icon, (void *)t.Ports[i], 2, tmp, status); + LvInsertAdd(b, icon, (void *)t2.Ports[i], 2, tmp, status); } LvInsertEnd(b, hWnd, L_LISTENER); - FreeRpcListenerList(&t); + FreeRpcListenerList(&t2); } // Get the DDNS client state diff --git a/src/Mayaqua/Network.c b/src/Mayaqua/Network.c index b6d339c7..b6fba840 100644 --- a/src/Mayaqua/Network.c +++ b/src/Mayaqua/Network.c @@ -5828,11 +5828,10 @@ int SslCertVerifyCallback(int preverify_ok, X509_STORE_CTX *ctx) if (clientcert != NULL) { - clientcert->PreverifyErr = 0; + clientcert->PreverifyErr = X509_STORE_CTX_get_error(ctx); clientcert->PreverifyErrMessage[0] = '\0'; if (!preverify_ok) { - clientcert->PreverifyErr = X509_STORE_CTX_get_error(ctx); const char *msg = X509_verify_cert_error_string(clientcert->PreverifyErr); StrCpy(clientcert->PreverifyErrMessage, PREVERIFY_ERR_MESSAGE_SIZE, msg); Debug("SslCertVerifyCallback preverify error: '%s'\n", msg);