DevStudio 10 patches

pull/1/head
toddouska 2012-03-23 10:42:07 -07:00
parent 1595d5bb3f
commit 36529ad873
4 changed files with 14 additions and 14 deletions

View File

@ -1845,7 +1845,7 @@ int ecc_test()
byte sharedB[1024]; byte sharedB[1024];
byte sig[1024]; byte sig[1024];
byte digest[20]; byte digest[20];
byte export[1024]; byte exportBuf[1024];
word32 x, y; word32 x, y;
int i, verify, ret; int i, verify, ret;
ecc_key userA, userB, pubKey; ecc_key userA, userB, pubKey;
@ -1879,12 +1879,12 @@ int ecc_test()
if (memcmp(sharedA, sharedB, x)) if (memcmp(sharedA, sharedB, x))
return -1005; return -1005;
x = sizeof(export); x = sizeof(exportBuf);
ret = ecc_export_x963(&userA, export, &x); ret = ecc_export_x963(&userA, exportBuf, &x);
if (ret != 0) if (ret != 0)
return -1006; return -1006;
ret = ecc_import_x963(export, x, &pubKey); ret = ecc_import_x963(exportBuf, x, &pubKey);
if (ret != 0) if (ret != 0)
return -1007; return -1007;

View File

@ -331,8 +331,8 @@ static INLINE int udp_read_connect(SOCKET_T sockfd)
int n; int n;
socklen_t len = sizeof(cliaddr); socklen_t len = sizeof(cliaddr);
n = recvfrom(sockfd, b, sizeof(b), MSG_PEEK, (struct sockaddr*)&cliaddr, n = recvfrom(sockfd, (char*)b, sizeof(b), MSG_PEEK,
&len); (struct sockaddr*)&cliaddr, &len);
if (n > 0) { if (n > 0) {
if (connect(sockfd, (const struct sockaddr*)&cliaddr, if (connect(sockfd, (const struct sockaddr*)&cliaddr,
sizeof(cliaddr)) != 0) sizeof(cliaddr)) != 0)

View File

@ -4832,8 +4832,8 @@ int SetCipherList(Suites* s, const char* list)
byte *output; byte *output;
word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ; word32 length, idx = RECORD_HEADER_SZ + HANDSHAKE_HEADER_SZ;
int sendSz; int sendSz;
byte export[MAX_EXPORT_ECC_SZ]; byte exportBuf[MAX_EXPORT_ECC_SZ];
word32 expSz = sizeof(export); word32 expSz = sizeof(exportBuf);
word32 sigSz; word32 sigSz;
word32 preSigSz, preSigIdx; word32 preSigSz, preSigIdx;
RsaKey rsaKey; RsaKey rsaKey;
@ -4842,7 +4842,7 @@ int SetCipherList(Suites* s, const char* list)
/* curve type, named curve, length(1) */ /* curve type, named curve, length(1) */
length = ENUM_LEN + CURVE_LEN + ENUM_LEN; length = ENUM_LEN + CURVE_LEN + ENUM_LEN;
/* pub key size */ /* 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; return ECC_EXPORT_ERROR;
length += expSz; length += expSz;
@ -4913,14 +4913,14 @@ int SetCipherList(Suites* s, const char* list)
output[idx++] = named_curve; output[idx++] = named_curve;
output[idx++] = 0x00; /* leading zero */ output[idx++] = 0x00; /* leading zero */
output[idx++] = SetCurveId(ecc_size(&ssl->eccTempKey)); output[idx++] = SetCurveId(ecc_size(&ssl->eccTempKey));
output[idx++] = expSz; output[idx++] = (byte)expSz;
XMEMCPY(output + idx, export, expSz); XMEMCPY(output + idx, exportBuf, expSz);
idx += expSz; idx += expSz;
if (IsAtLeastTLSv1_2(ssl)) { if (IsAtLeastTLSv1_2(ssl)) {
output[idx++] = sha_mac; output[idx++] = sha_mac;
output[idx++] = ssl->specs.sig_algo; output[idx++] = ssl->specs.sig_algo;
} }
c16toa(sigSz, output + idx); c16toa((word16)sigSz, output + idx);
idx += LENGTH_SZ; idx += LENGTH_SZ;
/* do signature */ /* do signature */

View File

@ -3529,11 +3529,11 @@ int CyaSSL_set_compression(CYASSL* ssl)
if (!md) return 0; /* no static buffer support */ if (!md) return 0; /* no static buffer support */
if (XSTRNCMP(evp_md, "MD5", 3) == 0) { 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; if (md_len) *md_len = MD5_DIGEST_SIZE;
} }
else if (XSTRNCMP(evp_md, "SHA", 3) == 0) { 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; if (md_len) *md_len = SHA_DIGEST_SIZE;
} }
else else