diff --git a/mozilla/security/nss/lib/freebl/alg2268.c b/mozilla/security/nss/lib/freebl/alg2268.c index 4463e8179a7..1a7e1df03c9 100644 --- a/mozilla/security/nss/lib/freebl/alg2268.c +++ b/mozilla/security/nss/lib/freebl/alg2268.c @@ -32,7 +32,7 @@ * may use your version of this file under either the MPL or the * GPL. * - * $Id: alg2268.c,v 1.2 2001-01-05 22:37:46 mcgreer%netscape.com Exp $ + * $Id: alg2268.c,v 1.3 2001-09-20 22:14:04 relyea%netscape.com Exp $ */ @@ -146,7 +146,9 @@ RC2_CreateContext(unsigned char *key, unsigned int len, RC2Context *cx; PRUint8 *L,*L2; int i; +#if !defined(IS_LITTLE_ENDIAN) PRUint16 tmpS; +#endif PRUint8 tmpB; if (!key || len == 0 || len > (sizeof cx->B) || efLen8 > (sizeof cx->B)) { diff --git a/mozilla/security/nss/lib/freebl/arcfour.c b/mozilla/security/nss/lib/freebl/arcfour.c index 9ee5b4f92d4..71de64b2d8a 100644 --- a/mozilla/security/nss/lib/freebl/arcfour.c +++ b/mozilla/security/nss/lib/freebl/arcfour.c @@ -403,6 +403,7 @@ rc4_wordconv(RC4Context *cx, unsigned char *output, /* If buffers are relatively misaligned, shift the bytes in inWord * to be aligned to the output buffer. */ + nextInWord = 0; if (inOffset < outOffset) { /* Have more bytes than needed, shift remainder into nextInWord */ nextInWord = inWord LSH 8*(inOffset + byteCount); @@ -423,10 +424,7 @@ rc4_wordconv(RC4Context *cx, unsigned char *output, /* move to next word of output */ pOutWord++; /* inWord has been consumed, but there may be bytes in nextInWord */ - if (inOffset == outOffset) - inWord = 0; - else - inWord = nextInWord; + inWord = nextInWord; } else { /* output is word-aligned */ pOutWord = (WORD *)output; diff --git a/mozilla/security/nss/lib/freebl/dh.c b/mozilla/security/nss/lib/freebl/dh.c index 1f4c369968b..7222eb500c8 100644 --- a/mozilla/security/nss/lib/freebl/dh.c +++ b/mozilla/security/nss/lib/freebl/dh.c @@ -35,7 +35,7 @@ * Diffie-Hellman parameter generation, key generation, and secret derivation. * KEA secret generation and verification. * - * $Id: dh.c,v 1.5 2000-09-29 02:10:24 mcgreer%netscape.com Exp $ + * $Id: dh.c,v 1.6 2001-09-20 22:14:06 relyea%netscape.com Exp $ */ #include "prerr.h" @@ -213,7 +213,7 @@ DH_Derive(SECItem *publicValue, { mp_int p, Xa, Yb, ZZ; mp_err err = MP_OKAY; - unsigned int len, nb; + unsigned int len = 0, nb; unsigned char *secret = NULL; if (!publicValue || !prime || !privateValue || !derivedSecret) { PORT_SetError(SEC_ERROR_INVALID_ARGS); @@ -278,7 +278,7 @@ KEA_Derive(SECItem *prime, mp_int p, Y, R, r, x, t, u, w; mp_err err; unsigned char *secret = NULL; - unsigned int len, offset; + unsigned int len = 0, offset; if (!prime || !public1 || !public2 || !private1 || !private2 || !derivedSecret) { PORT_SetError(SEC_ERROR_INVALID_ARGS); diff --git a/mozilla/security/nss/lib/freebl/md5.c b/mozilla/security/nss/lib/freebl/md5.c index b0c0ed6a0c9..c1e55902c7c 100644 --- a/mozilla/security/nss/lib/freebl/md5.c +++ b/mozilla/security/nss/lib/freebl/md5.c @@ -461,7 +461,9 @@ void MD5_End(MD5Context *cx, unsigned char *digest, unsigned int *digestLen, unsigned int maxDigestLen) { +#ifndef IS_LITTLE_ENDIAN PRUint32 tmp; +#endif PRUint32 lowInput, highInput; PRUint32 inBufIndex = cx->lsbInput & 63; diff --git a/mozilla/security/nss/lib/freebl/mpi/mpi.c b/mozilla/security/nss/lib/freebl/mpi/mpi.c index eb80f8a6116..0cf22e6a018 100644 --- a/mozilla/security/nss/lib/freebl/mpi/mpi.c +++ b/mozilla/security/nss/lib/freebl/mpi/mpi.c @@ -35,7 +35,7 @@ * the GPL. If you do not delete the provisions above, a recipient * may use your version of this file under either the MPL or the GPL. * - * $Id: mpi.c,v 1.35 2001-06-18 19:54:21 wtc%netscape.com Exp $ + * $Id: mpi.c,v 1.36 2001-09-20 22:14:09 relyea%netscape.com Exp $ */ #include "mpi-priv.h" @@ -2295,8 +2295,8 @@ mp_err s_mp_invmod_even_m(const mp_int *a, const mp_int *m, mp_int *c) mp_int oddPart, evenPart; /* parts to combine via CRT. */ mp_int C2, tmp1, tmp2; - static const mp_digit d1 = 1; - static const mp_int one = { MP_ZPOS, 1, 1, (mp_digit *)&d1 }; + /*static const mp_digit d1 = 1; */ + /*static const mp_int one = { MP_ZPOS, 1, 1, (mp_digit *)&d1 }; */ if ((res = s_mp_ispow2(m)) >= 0) { k = res; @@ -3363,7 +3363,7 @@ mp_err s_mp_div_d(mp_int *mp, mp_digit d, mp_digit *r) } #else { - mp_digit norm, p; + mp_digit p; MP_CHECKOK( mp_init_copy(&rem, mp) ); diff --git a/mozilla/security/nss/lib/freebl/rsa.c b/mozilla/security/nss/lib/freebl/rsa.c index d224a52c358..31ab189f6f6 100644 --- a/mozilla/security/nss/lib/freebl/rsa.c +++ b/mozilla/security/nss/lib/freebl/rsa.c @@ -35,7 +35,7 @@ /* * RSA key generation, public key op, private key op. * - * $Id: rsa.c,v 1.25 2001-04-12 20:23:42 nicolson%netscape.com Exp $ + * $Id: rsa.c,v 1.26 2001-09-20 22:14:06 relyea%netscape.com Exp $ */ #include "secerr.h" @@ -626,7 +626,7 @@ RSA_PrivateKeyOp(RSAPrivateKey *key, { unsigned int modLen; unsigned int offset; - SECStatus rv; + SECStatus rv = SECSuccess; mp_err err; mp_int n, c, m; mp_int f, g; diff --git a/mozilla/security/nss/lib/freebl/sha_fast.h b/mozilla/security/nss/lib/freebl/sha_fast.h index 7326689a9dd..d371f93320c 100644 --- a/mozilla/security/nss/lib/freebl/sha_fast.h +++ b/mozilla/security/nss/lib/freebl/sha_fast.h @@ -49,8 +49,8 @@ struct SHA1ContextStr { #define SHA_MASK 0x00FF00FF #if defined(IS_LITTLE_ENDIAN) -#define SHA_HTONL(x) (A = (x), A = A << 16 | A >> 16, \ - (A & SHA_MASK) << 8 | (A >> 8) & SHA_MASK) +#define SHA_HTONL(x) (A = (x), A = (A << 16) | (A >> 16), \ + ((A & SHA_MASK) << 8) | ((A >> 8) & SHA_MASK)) #else #define SHA_HTONL(x) (x) #endif