Skip to content

Commit db14914

Browse files
committed
Fixes for building wolfSSL in Visual Studio. Adds missing files. Fix for type cast warnings.
1 parent 2c9208b commit db14914

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
@@ -27050,7 +27050,7 @@ int DecodePrivateKey(WOLFSSL *ssl, word16* length)
2705027050
|| wolfSSL_CTX_IsPrivatePkSet(ssl->ctx)
2705127051
#endif
2705227052
) {
27053-
*length = GetPrivateKeySigSize(ssl);
27053+
*length = (word16)GetPrivateKeySigSize(ssl);
2705427054
return 0;
2705527055
}
2705627056
else
@@ -31582,7 +31582,7 @@ int SendCertificateVerify(WOLFSSL* ssl)
3158231582
if (ssl->buffers.key == NULL) {
3158331583
#ifdef HAVE_PK_CALLBACKS
3158431584
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx))
31585-
args->length = GetPrivateKeySigSize(ssl);
31585+
args->length = (word16)GetPrivateKeySigSize(ssl);
3158631586
else
3158731587
#endif
3158831588
ERROR_OUT(NO_PRIVATE_KEY, exit_scv);
@@ -33555,7 +33555,7 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
3355533555
if (ssl->buffers.key == NULL) {
3355633556
#ifdef HAVE_PK_CALLBACKS
3355733557
if (wolfSSL_CTX_IsPrivatePkSet(ssl->ctx))
33558-
keySz = (word32)GetPrivateKeySigSize(ssl);
33558+
keySz = (word16)GetPrivateKeySigSize(ssl);
3355933559
else
3356033560
#endif
3356133561
ERROR_OUT(NO_PRIVATE_KEY, exit_sske);

src/ssl.c

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

77807780
#ifdef WOLF_PRIVATE_KEY_ID
77817781
if (ssl != NULL) {
7782-
ssl->buffers.keyType = keyType;
7782+
ssl->buffers.keyType = (byte)keyType;
77837783
ssl->buffers.keySz = keySz;
77847784
}
77857785
else if (ctx != NULL) {
7786-
ctx->privateKeyType = keyType;
7786+
ctx->privateKeyType = (byte)keyType;
77877787
ctx->privateKeySz = keySz;
77887788
}
77897789
#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)