mirror of https://github.com/wolfSSL/wolfssl.git
DevStudio 10 patches
parent
1595d5bb3f
commit
36529ad873
|
@ -1845,7 +1845,7 @@ int ecc_test()
|
|||
byte sharedB[1024];
|
||||
byte sig[1024];
|
||||
byte digest[20];
|
||||
byte export[1024];
|
||||
byte exportBuf[1024];
|
||||
word32 x, y;
|
||||
int i, verify, ret;
|
||||
ecc_key userA, userB, pubKey;
|
||||
|
@ -1879,12 +1879,12 @@ int ecc_test()
|
|||
if (memcmp(sharedA, sharedB, x))
|
||||
return -1005;
|
||||
|
||||
x = sizeof(export);
|
||||
ret = ecc_export_x963(&userA, export, &x);
|
||||
x = sizeof(exportBuf);
|
||||
ret = ecc_export_x963(&userA, exportBuf, &x);
|
||||
if (ret != 0)
|
||||
return -1006;
|
||||
|
||||
ret = ecc_import_x963(export, x, &pubKey);
|
||||
ret = ecc_import_x963(exportBuf, x, &pubKey);
|
||||
|
||||
if (ret != 0)
|
||||
return -1007;
|
||||
|
|
|
@ -331,8 +331,8 @@ static INLINE int udp_read_connect(SOCKET_T sockfd)
|
|||
int n;
|
||||
socklen_t len = sizeof(cliaddr);
|
||||
|
||||
n = recvfrom(sockfd, b, sizeof(b), MSG_PEEK, (struct sockaddr*)&cliaddr,
|
||||
&len);
|
||||
n = recvfrom(sockfd, (char*)b, sizeof(b), MSG_PEEK,
|
||||
(struct sockaddr*)&cliaddr, &len);
|
||||
if (n > 0) {
|
||||
if (connect(sockfd, (const struct sockaddr*)&cliaddr,
|
||||
sizeof(cliaddr)) != 0)
|
||||
|
|
|
@ -4832,8 +4832,8 @@ int SetCipherList(Suites* s, const char* list)
|
|||
byte *output;
|
||||
word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
|
||||
int sendSz;
|
||||
byte export[MAX_EXPORT_ECC_SZ];
|
||||
word32 expSz = sizeof(export);
|
||||
byte exportBuf[MAX_EXPORT_ECC_SZ];
|
||||
word32 expSz = sizeof(exportBuf);
|
||||
word32 sigSz;
|
||||
word32 preSigSz, preSigIdx;
|
||||
RsaKey rsaKey;
|
||||
|
@ -4842,7 +4842,7 @@ int SetCipherList(Suites* s, const char* list)
|
|||
/* curve type, named curve, length(1) */
|
||||
length = ENUM_LEN + CURVE_LEN + ENUM_LEN;
|
||||
/* pub key size */
|
||||
if (ecc_export_x963(&ssl->eccTempKey, export, &expSz) != 0)
|
||||
if (ecc_export_x963(&ssl->eccTempKey, exportBuf, &expSz) != 0)
|
||||
return ECC_EXPORT_ERROR;
|
||||
length += expSz;
|
||||
|
||||
|
@ -4913,14 +4913,14 @@ int SetCipherList(Suites* s, const char* list)
|
|||
output[idx++] = named_curve;
|
||||
output[idx++] = 0x00; /* leading zero */
|
||||
output[idx++] = SetCurveId(ecc_size(&ssl->eccTempKey));
|
||||
output[idx++] = expSz;
|
||||
XMEMCPY(output + idx, export, expSz);
|
||||
output[idx++] = (byte)expSz;
|
||||
XMEMCPY(output + idx, exportBuf, expSz);
|
||||
idx += expSz;
|
||||
if (IsAtLeastTLSv1_2(ssl)) {
|
||||
output[idx++] = sha_mac;
|
||||
output[idx++] = ssl->specs.sig_algo;
|
||||
}
|
||||
c16toa(sigSz, output + idx);
|
||||
c16toa((word16)sigSz, output + idx);
|
||||
idx += LENGTH_SZ;
|
||||
|
||||
/* do signature */
|
||||
|
|
|
@ -3529,11 +3529,11 @@ int CyaSSL_set_compression(CYASSL* ssl)
|
|||
if (!md) return 0; /* no static buffer support */
|
||||
|
||||
if (XSTRNCMP(evp_md, "MD5", 3) == 0) {
|
||||
HmacSetKey(&hmac, MD5, key, key_len);
|
||||
HmacSetKey(&hmac, MD5, (const byte*)key, key_len);
|
||||
if (md_len) *md_len = MD5_DIGEST_SIZE;
|
||||
}
|
||||
else if (XSTRNCMP(evp_md, "SHA", 3) == 0) {
|
||||
HmacSetKey(&hmac, SHA, key, key_len);
|
||||
HmacSetKey(&hmac, SHA, (const byte*)key, key_len);
|
||||
if (md_len) *md_len = SHA_DIGEST_SIZE;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue