Skip to content

Commit 9d0bb4c

Browse files
Merge pull request #7040 from dgarske/win_vs
Fixes for building wolfSSL in Visual Studio
2 parents c6d6100 + db14914 commit 9d0bb4c

6 files changed

Lines changed: 13 additions & 11 deletions

File tree

IDE/WIN10/wolfssl-fips.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@
272272
<ClCompile Include="..\..\wolfcrypt\src\hash.c" />
273273
<ClCompile Include="..\..\wolfcrypt\src\hmac.c" />
274274
<ClCompile Include="..\..\wolfcrypt\src\integer.c" />
275+
<ClCompile Include="..\..\wolfcrypt\src\pkcs7.c" />
275276
<ClCompile Include="..\..\wolfcrypt\src\tfm.c" />
276277
<ClCompile Include="..\..\src\internal.c" />
277278
<ClCompile Include="..\..\src\wolfio.c" />

src/internal.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27080,7 +27080,7 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
2708027080
|| wolfSSL_CTX_IsPrivatePkSet(ssl->ctx)
2708127081
#endif
2708227082
) {
27083-
*length = GetPrivateKeySigSize(ssl);
27083+
*length = (word16)GetPrivateKeySigSize(ssl);
2708427084
return 0;
2708527085
}
2708627086
else
@@ -31612,7 +31612,7 @@ int SendCertificateVerify(WOLFSSL* ssl)
3161231612
if (ssl->buffers.key == NULL) {
3161331613
#ifdef HAVE_PK_CALLBACKS
3161431614
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx))
31615-
args->length = GetPrivateKeySigSize(ssl);
31615+
args->length = (word16)GetPrivateKeySigSize(ssl);
3161631616
else
3161731617
#endif
3161831618
ERROR_OUT(NO_PRIVATE_KEY, exit_scv);
@@ -33585,7 +33585,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3358533585
if (ssl->buffers.key == NULL) {
3358633586
#ifdef HAVE_PK_CALLBACKS
3358733587
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx))
33588-
keySz = (word32)GetPrivateKeySigSize(ssl);
33588+
keySz = (word16)GetPrivateKeySigSize(ssl);
3358933589
else
3359033590
#endif
3359133591
ERROR_OUT(NO_PRIVATE_KEY, exit_sske);

src/ssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7786,11 +7786,11 @@ int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff,
77867786

77877787
#ifdef WOLF_PRIVATE_KEY_ID
77887788
if (ssl != NULL) {
7789-
ssl->buffers.keyType = keyType;
7789+
ssl->buffers.keyType = (byte)keyType;
77907790
ssl->buffers.keySz = keySz;
77917791
}
77927792
else if (ctx != NULL) {
7793-
ctx->privateKeyType = keyType;
7793+
ctx->privateKeyType = (byte)keyType;
77947794
ctx->privateKeySz = keySz;
77957795
}
77967796
#endif

src/tls13.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8633,7 +8633,7 @@ static int SendTls13CertificateVerify(WOLFSSL* ssl)
86338633
if (ssl->buffers.key == NULL) {
86348634
#ifdef HAVE_PK_CALLBACKS
86358635
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx))
8636-
args->length = GetPrivateKeySigSize(ssl);
8636+
args->length = (word16)GetPrivateKeySigSize(ssl);
86378637
else
86388638
#endif
86398639
ERROR_OUT(NO_PRIVATE_KEY, exit_scv);

wolfcrypt/src/pkcs7.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4627,7 +4627,7 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
46274627
WOLFSSL_MSG("PKCS#7 signedData needs to be version 1 or 3");
46284628
ret = ASN_VERSION_E;
46294629
}
4630-
pkcs7->version = version;
4630+
pkcs7->version = (byte)version;
46314631

46324632
/* Get the set of DigestAlgorithmIdentifiers */
46334633
if (ret == 0 && GetSet(pkiMsg, &idx, &length, pkiMsgSz) < 0)
@@ -4913,7 +4913,7 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
49134913
if (multiPart) {
49144914
pkcs7->stream->expected = contentLen + ASN_TAG_SZ;
49154915
}
4916-
pkcs7->stream->multi = multiPart;
4916+
pkcs7->stream->multi = (byte)multiPart;
49174917

49184918
#endif
49194919
wc_PKCS7_ChangeState(pkcs7, WC_PKCS7_VERIFY_STAGE3);
@@ -5221,7 +5221,7 @@ static int PKCS7_VerifySignedData(PKCS7* pkcs7, const byte* hashBuf,
52215221
pkcs7->stream = stream;
52225222
#endif
52235223
}
5224-
pkcs7->version = version;
5224+
pkcs7->version = (byte)version;
52255225
#ifdef ASN_BER_TO_DER
52265226
pkcs7->der = der;
52275227
#endif
@@ -7692,7 +7692,7 @@ static int wc_PKCS7_PwriKek_KeyWrap(PKCS7* pkcs7, const byte* kek, word32 kekSz,
76927692
if (*outSz < (word32)outLen)
76937693
return BUFFER_E;
76947694

7695-
out[0] = cekSz;
7695+
out[0] = (byte)cekSz;
76967696
out[1] = ~cek[0];
76977697
out[2] = ~cek[1];
76987698
out[3] = ~cek[2];
@@ -10845,7 +10845,7 @@ WOLFSSL_API int wc_PKCS7_DecodeEnvelopedData(PKCS7* pkcs7, byte* in,
1084510845
byte* encryptedContent = NULL;
1084610846
int explicitOctet = 0;
1084710847
word32 localIdx;
10848-
byte tag;
10848+
byte tag = 0;
1084910849

1085010850
if (pkcs7 == NULL)
1085110851
return BAD_FUNC_ARG;

wolfssl.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@
299299
<ClCompile Include="wolfcrypt\src\curve25519.c" />
300300
<ClCompile Include="wolfcrypt\src\curve448.c" />
301301
<ClCompile Include="wolfcrypt\src\cpuid.c" />
302+
<ClCompile Include="wolfcrypt\src\cryptocb.c" />
302303
<ClCompile Include="wolfcrypt\src\des3.c" />
303304
<ClCompile Include="wolfcrypt\src\dh.c" />
304305
<ClCompile Include="wolfcrypt\src\dsa.c" />

0 commit comments

Comments
 (0)