1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2024-12-27 10:39:53 +03:00

Merge PR #962: Fix several compile warnings on MS VC++ 2008.

This commit is contained in:
Davide Beatrici 2019-08-04 04:03:14 +02:00 committed by GitHub
commit d10f83417f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 15 deletions

View File

@ -195,13 +195,13 @@ bool SmbAuthenticate(char* name, char* password, char* domainname, char* groupna
return false;
}
if (base64_enc_len(strlen(name)) < sizeof(buffer)-1 &&
base64_enc_len(strlen(password)) < sizeof(buffer)-1 &&
base64_enc_len(strlen(domainname)) < sizeof(buffer)-1)
if (base64_enc_len((unsigned int)strlen(name)) < sizeof(buffer)-1 &&
base64_enc_len((unsigned int)strlen(password)) < sizeof(buffer)-1 &&
base64_enc_len((unsigned int)strlen(domainname)) < sizeof(buffer)-1)
{
char answer[300];
unsigned int end = B64_Encode(buffer, name, strlen(name));
unsigned int end = B64_Encode(buffer, name, (int)strlen(name));
buffer[end] = '\0';
fputs("Username:: ", out);
fputs(buffer, out);
@ -209,7 +209,7 @@ bool SmbAuthenticate(char* name, char* password, char* domainname, char* groupna
Debug("Username: %s\n", buffer);
buffer[0] = 0;
end = B64_Encode(buffer, domainname, strlen(domainname));
end = B64_Encode(buffer, domainname, (int)strlen(domainname));
buffer[end] = '\0';
fputs("NT-Domain:: ", out);
fputs(buffer, out);
@ -220,7 +220,7 @@ bool SmbAuthenticate(char* name, char* password, char* domainname, char* groupna
if (password[0] != '\0')
{
Debug("Password authentication\n");
end = B64_Encode(buffer, password, strlen(password));
end = B64_Encode(buffer, password, (int)strlen(password));
buffer[end] = '\0';
fputs("Password:: ", out);
fputs(buffer, out);

View File

@ -1650,12 +1650,12 @@ X509 *NewX509(K *pub, K *priv, X *ca, NAME *name, UINT days, X_SERIAL *serial)
// Set the Expiration
t1 = X509_get0_notBefore(x509);
t2 = X509_get0_notAfter(x509);
if (!UINT64ToAsn1Time(t1, notBefore))
if (!UINT64ToAsn1Time((void *)t1, notBefore))
{
FreeX509(x509);
return NULL;
}
if (!UINT64ToAsn1Time(t2, notAfter))
if (!UINT64ToAsn1Time((void *)t2, notAfter))
{
FreeX509(x509);
return NULL;
@ -1792,12 +1792,12 @@ X509 *NewRootX509(K *pub, K *priv, NAME *name, UINT days, X_SERIAL *serial)
// Set the Expiration
t1 = X509_get0_notBefore(x509);
t2 = X509_get0_notAfter(x509);
if (!UINT64ToAsn1Time(t1, notBefore))
if (!UINT64ToAsn1Time((void *)t1, notBefore))
{
FreeX509(x509);
return NULL;
}
if (!UINT64ToAsn1Time(t2, notAfter))
if (!UINT64ToAsn1Time((void *)t2, notAfter))
{
FreeX509(x509);
return NULL;
@ -4432,7 +4432,7 @@ static UINT Internal_HMac(const EVP_MD *md, void *dest, void *key, UINT key_size
goto final;
}
len = MdProcess(m, dest, src, src_size);
len = MdProcess(m, dest, (void *)src, src_size);
if (len == 0)
{
Debug("Internal_HMac(): MdProcess() returned 0!\n");

View File

@ -5563,7 +5563,7 @@ int SslCertVerifyCallback(int preverify_ok, X509_STORE_CTX *ctx)
if (!preverify_ok)
{
const char *msg = X509_verify_cert_error_string(clientcert->PreverifyErr);
StrCpy(clientcert->PreverifyErrMessage, PREVERIFY_ERR_MESSAGE_SIZE, msg);
StrCpy(clientcert->PreverifyErrMessage, PREVERIFY_ERR_MESSAGE_SIZE, (char *)msg);
Debug("SslCertVerifyCallback preverify error: '%s'\n", msg);
}
else
@ -16532,12 +16532,12 @@ TOKEN_LIST *GetCipherList()
sk = SSL_get_ciphers(ssl);
#endif
for (i = 0; i < sk_SSL_CIPHER_num(sk); i++)
for (i = 0; i < (UINT)sk_SSL_CIPHER_num(sk); i++)
{
const SSL_CIPHER *c = sk_SSL_CIPHER_value(sk, i);
name = SSL_CIPHER_get_name(c);
if (IsEmptyStr(name))
if (IsEmptyStr((char *)name))
{
break;
}
@ -16553,7 +16553,7 @@ TOKEN_LIST *GetCipherList()
ciphers->Token = Malloc(sizeof(char *));
}
ciphers->Token[i] = CopyStr(name);
ciphers->Token[i] = CopyStr((char *)name);
}
sk_SSL_CIPHER_free(sk);