fix MPLAB X windows warnings

pull/1/head
toddouska 2013-05-17 11:13:47 -07:00
parent a4c6ed0dda
commit 8f5e98486f
2 changed files with 12 additions and 10 deletions

View File

@ -249,25 +249,27 @@ static INLINE int DoProcess(Rabbit* ctx, byte* output, const byte* input,
if (msglen) { if (msglen) {
word32 i; word32 i;
byte buffer[16]; word32 tmp[4];
byte* buffer = (byte*)tmp;
XMEMSET(tmp, 0, sizeof(tmp)); /* help static analysis */
/* Iterate the system */ /* Iterate the system */
RABBIT_next_state(&(ctx->workCtx)); RABBIT_next_state(&(ctx->workCtx));
/* Generate 16 bytes of pseudo-random data */ /* Generate 16 bytes of pseudo-random data */
*(word32*)(buffer+ 0) = LITTLE32(ctx->workCtx.x[0] ^ tmp[0] = LITTLE32(ctx->workCtx.x[0] ^
(ctx->workCtx.x[5]>>16) ^ U32V(ctx->workCtx.x[3]<<16)); (ctx->workCtx.x[5]>>16) ^ U32V(ctx->workCtx.x[3]<<16));
*(word32*)(buffer+ 4) = LITTLE32(ctx->workCtx.x[2] ^ tmp[1] = LITTLE32(ctx->workCtx.x[2] ^
(ctx->workCtx.x[7]>>16) ^ U32V(ctx->workCtx.x[5]<<16)); (ctx->workCtx.x[7]>>16) ^ U32V(ctx->workCtx.x[5]<<16));
*(word32*)(buffer+ 8) = LITTLE32(ctx->workCtx.x[4] ^ tmp[2] = LITTLE32(ctx->workCtx.x[4] ^
(ctx->workCtx.x[1]>>16) ^ U32V(ctx->workCtx.x[7]<<16)); (ctx->workCtx.x[1]>>16) ^ U32V(ctx->workCtx.x[7]<<16));
*(word32*)(buffer+12) = LITTLE32(ctx->workCtx.x[6] ^ tmp[3] = LITTLE32(ctx->workCtx.x[6] ^
(ctx->workCtx.x[3]>>16) ^ U32V(ctx->workCtx.x[1]<<16)); (ctx->workCtx.x[3]>>16) ^ U32V(ctx->workCtx.x[1]<<16));
/* Encrypt/decrypt the data */ /* Encrypt/decrypt the data */
for (i=0; i<msglen; i++) for (i=0; i<msglen; i++)
output[i] = input[i] ^ buffer[i]; /* scan-build thinks buffer[i] */ output[i] = input[i] ^ buffer[i];
/* is garbage, it is not! */
} }
return 0; return 0;

View File

@ -6914,7 +6914,7 @@ int SetCipherList(Suites* s, const char* list)
if (ssl->options.haveSessionId && XMEMCMP(ssl->arrays->sessionID, if (ssl->options.haveSessionId && XMEMCMP(ssl->arrays->sessionID,
ssl->session.sessionID, ID_LEN) == 0) { ssl->session.sessionID, ID_LEN) == 0) {
if (SetCipherSpecs(ssl) == 0) { if (SetCipherSpecs(ssl) == 0) {
int ret; int ret = -1;
XMEMCPY(ssl->arrays->masterSecret, XMEMCPY(ssl->arrays->masterSecret,
ssl->session.masterSecret, SECRET_LEN); ssl->session.masterSecret, SECRET_LEN);
#ifdef NO_OLD_TLS #ifdef NO_OLD_TLS
@ -9150,7 +9150,7 @@ int SetCipherList(Suites* s, const char* list)
ssl->options.haveSessionId = 1; ssl->options.haveSessionId = 1;
/* DoClientHello uses same resume code */ /* DoClientHello uses same resume code */
if (ssl->options.resuming) { /* let's try */ if (ssl->options.resuming) { /* let's try */
int ret; int ret = -1;
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret); CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
if (!session) { if (!session) {
CYASSL_MSG("Session lookup for resume failed"); CYASSL_MSG("Session lookup for resume failed");
@ -9369,7 +9369,7 @@ int SetCipherList(Suites* s, const char* list)
ssl->options.haveSessionId = 1; ssl->options.haveSessionId = 1;
/* ProcessOld uses same resume code */ /* ProcessOld uses same resume code */
if (ssl->options.resuming) { /* let's try */ if (ssl->options.resuming) { /* let's try */
int ret; int ret = -1;
CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret); CYASSL_SESSION* session = GetSession(ssl,ssl->arrays->masterSecret);
if (!session) { if (!session) {
CYASSL_MSG("Session lookup for resume failed"); CYASSL_MSG("Session lookup for resume failed");