Cannot compile latest source code

Post your questions about SoftEther VPN software here. Please answer questions if you can afford.
Post Reply
caubemuongte
Posts: 1
Joined: Mon Apr 16, 2018 1:23 am

Cannot compile latest source code

Post by caubemuongte » Mon Apr 16, 2018 2:21 am

I checked out latest source code from Github.
and got these errors when compiling MayAqua project:
-- MayAqua:
.\Network.c(5836) : error C2143: syntax error : missing ';' before 'const'
.\Network.c(5837) : error C2065: 'msg' : undeclared identifier
.\Network.c(5837) : warning C4047: 'function' : 'char *' differs in levels of indirection from 'int'
.\Network.c(5837) : warning C4024: 'StrCpy' : different types for formal and actual parameter 3
.\Network.c(5838) : error C2065: 'msg' : undeclared identifier
.\Network.c(5858) : error C2143: syntax error : missing '{' before '*'
.\Network.c(5859) : error C2371: 'NewSslPipe' : redefinition; different basic types
C:\HLK\vpn\SoftEtherVPN\src\Mayaqua/Network.h(1626) : see declaration of 'NewSslPipe'
.\Network.c(5860) : warning C4133: 'return' : incompatible types - from 'SSL_PIPE *' to 'int *'
Microsoft.c

I found this function caused the problem:
MayAqua/Network.c
// Verify client SSL certificate during TLS handshake.
//
// (actually, only save the certificate for later authentication in Protocol.c)
int SslCertVerifyCallback(int preverify_ok, X509_STORE_CTX *ctx)
{
SSL *ssl;
struct SslClientCertInfo *clientcert;
X509 *cert;

ssl = X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
clientcert = SSL_get_ex_data(ssl, GetSslClientCertIndex());

if (clientcert != NULL)
{
clientcert->PreverifyErr = 0;
clientcert->PreverifyErrMessage[0] = '\0';
if (!preverify_ok)
{
clientcert->PreverifyErr = X509_STORE_CTX_get_error(ctx); //errors here
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);
}
else
{
cert = X509_STORE_CTX_get0_cert(ctx);
if (cert != NULL)
{
X *tmpX = X509ToX(cert); // this only wraps cert, but we need to make a copy
X *copyX = CloneX(tmpX);
tmpX->do_not_free = true; // do not release inner X509 object
FreeX(tmpX);
clientcert->X = copyX;
}
}
}

return 1; /* allow the verification process to continue */
}

My environment: VS2008, Windows 7 pro.
This is my first time working with SoftEtherVPN and I have no experience in C++, too.
Please help :D

thisjun
Posts: 2686
Joined: Mon Feb 24, 2014 11:03 am

Re: Cannot compile latest source code

Post by thisjun » Wed May 16, 2018 8:11 am

The problem is fixed in latest (Apr 20, 2018) source code.
https://github.com/SoftEtherVPN/SoftEth ... /Network.c

Post Reply