Fix for Bug 87865 r=mcgreer,nelsonb sr=blizzard, a=asa MOZILLA_0_9_2_BRANCH
authorjavi%netscape.com
Thu, 28 Jun 2001 00:39:32 +0000
branchMOZILLA_0_9_2_BRANCH
changeset 1691 9875cecb142e96a4ffeff36c39b09849498947dd
parent 1669 68f88be068154b4c4540c59814c26020d88992f0
child 1693 ba993d16b10671d97a07d67c207f921ec3bd03e7
push idunknown
push userunknown
push dateunknown
reviewersmcgreer, nelsonb, blizzard, asa
bugs87865
Fix for Bug 87865 r=mcgreer,nelsonb sr=blizzard, a=asa Fix KEYGEN on the Mac by using the defined constant SEIVE_SIZE instead of the sizeof operator. This caused problem because the var sieve was of type unsigned char * instead of unsigned char[] like the other platforms.
security/nss/lib/freebl/mpi/mpprime.c
--- a/security/nss/lib/freebl/mpi/mpprime.c
+++ b/security/nss/lib/freebl/mpi/mpprime.c
@@ -475,32 +475,32 @@ mp_err mpp_make_prime(mp_int *start, mp_
     --nBits;
   MP_CHECKOK( mpl_set_bit(start, nBits - 1, 1) );
   MP_CHECKOK( mpl_set_bit(start,         0, 1) );
   for (i = mpl_significant_bits(start) - 1; i >= nBits; --i) {
     MP_CHECKOK( mpl_set_bit(start, i, 0) );
   }
   /* start sieveing with prime value of 3. */
   MP_CHECKOK(mpp_sieve(start, prime_tab + 1, prime_tab_size - 1, 
-		       sieve, sizeof sieve) );
+		       sieve, SIEVE_SIZE) );
 
 #ifdef DEBUG_SIEVE
   res = 0;
-  for (i = 0; i < sizeof sieve; ++i) {
+  for (i = 0; i < SIEVE_SIZE; ++i) {
     if (!sieve[i])
       ++res;
   }
   fprintf(stderr,"sieve found %d potential primes.\n", res);
 #define FPUTC(x,y) fputc(x,y)
 #else
 #define FPUTC(x,y) 
 #endif
 
   res = MP_NO;
-  for(i = 0; i < sizeof sieve; ++i) {
+  for(i = 0; i < SIEVE_SIZE; ++i) {
     if (sieve[i])	/* this number is composite */
       continue;
     MP_CHECKOK( mp_add_d(start, 2 * i, &trial) );
     FPUTC('.', stderr);
     /* run a Fermat test */
     res = mpp_fermat(&trial, 2);
     if (res != MP_OKAY) {
       if (res == MP_NO)