apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Some pending pathches for review/commit
Date Sun, 19 Sep 2004 17:07:28 GMT
At 10:47 AM 9/19/2004, Mladen Turk wrote:
>Trying for a third week :).

Keep trying :)  Several project releases distracted a number
of users of this list...

>so I'm sending them all at once with brief explanation for each.

Actually, it inhibits discussion to do that :(  I would like
to see Ben Laurie feedback to 2. and 5. since he understand
these better than most, and they implicate some unspoken
assumptions that he should review.  Ben?

For your 1. and 3. and 4. they are fine, simply commit them,
+1 to fix in both head and APR_0_9.

>2. apr_random.patch
>
>Set the hash tables to zero on init.
>Although the test are passing now, some deep explanation
>would be fine (probably from Ben Laurie).
>I presume that the unix is setting the
>memory to zero while on WIN32 it is set to 0xCD, and that's
>why the expected test values are never met on WIN32.
>
>5. sha2.patch
>
>Just fixes the compile time warnings caused by assigning 64
>bit values to 32 bit integers, by casting them to unsigned int.
>
>Index: apr_random.c
>===================================================================
>RCS file: /home/cvspublic/apr/random/unix/apr_random.c,v
>retrieving revision 1.9
>diff -u -r1.9 apr_random.c
>--- apr_random.c    28 Feb 2004 18:31:41 -0000    1.9
>+++ apr_random.c    28 Aug 2004 14:35:06 -0000
>@@ -111,8 +111,8 @@
>                     /2)*g->pool_hash->size*2;
>     g->reseed_size = APR_RANDOM_DEFAULT_RESEED_SIZE;
>
>-    g->H = apr_palloc(p,H_size(g));
>-    g->H_waiting = apr_palloc(p,H_size(g));
>+    g->H = apr_pcalloc(p,H_size(g));
>+    g->H_waiting = apr_pcalloc(p,H_size(g));
>
>     g->randomness = apr_palloc(p,B_size(g));
>     g->random_bytes = 0;
>
>Index: sha2.c
>===================================================================
>RCS file: /home/cvspublic/apr/random/unix/sha2.c,v
>retrieving revision 1.6
>diff -u -r1.6 sha2.c
>--- sha2.c    28 Feb 2004 18:31:41 -0000    1.6
>+++ sha2.c    27 Aug 2004 09:04:43 -0000
>@@ -458,7 +458,7 @@
>         /* Sanity check: */
>         assert(context != (SHA256_CTX*)0 && data != (sha2_byte*)0);
>
>-        usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
>+        usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH);
>         if (usedspace > 0) {
>                 /* Calculate how much free space is available in the buffer */
>                 freespace = SHA256_BLOCK_LENGTH - usedspace;
>@@ -504,7 +504,7 @@
>
>         /* If no digest buffer is passed, we don't bother doing this: */
>         if (digest != (sha2_byte*)0) {
>-                usedspace = (context->bitcount >> 3) % SHA256_BLOCK_LENGTH;
>+                usedspace = (unsigned int)((context->bitcount >> 3) % SHA256_BLOCK_LENGTH);
> #if !APR_IS_BIGENDIAN
>                 /* Convert FROM host byte order */
>                 REVERSE64(context->bitcount,context->bitcount);
>@@ -780,7 +780,7 @@
>         /* Sanity check: */
>         assert(context != (SHA512_CTX*)0 && data != (sha2_byte*)0);
>
>-        usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
>+        usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH);
>         if (usedspace > 0) {
>                 /* Calculate how much free space is available in the buffer */
>                 freespace = SHA512_BLOCK_LENGTH - usedspace;
>@@ -820,7 +820,7 @@
> void SHA512_Last(SHA512_CTX* context) {
>         unsigned int    usedspace;
>
>-        usedspace = (context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH;
>+        usedspace = (unsigned int)((context->bitcount[0] >> 3) % SHA512_BLOCK_LENGTH);
> #if !APR_IS_BIGENDIAN
>         /* Convert FROM host byte order */
>         REVERSE64(context->bitcount[0],context->bitcount[0]);



Mime
View raw message