Subject: Problem in in-kernel SHA1 implementation?
To: None <tech-kern@NetBSD.org>
From: Matthias Scheler <tron@zhadum.de>
List: tech-kern
Date: 06/29/2005 15:46:00
	Hello,

our in kernel SHA1 implementation contains this code:

#define SHA1HANDSOFF            /* Copies data before messing with it. */

void SHA1Transform(state, buffer)
    u_int32_t state[5];
    const u_char buffer[64];
{
[...]
#ifdef SHA1HANDSOFF
    static u_int workspace[16];				<--
    block = (CHAR64LONG16 *)workspace;
    (void)memcpy(block, buffer, 64);
#else
    block = (CHAR64LONG16 *)buffer;
#endif
[...]

This will break horribly if used by two kernel subsystems at the same time.
Is there any reason not to remove the "static"?

	Kind regards

-- 
Matthias Scheler                                  http://scheler.de/~matthias/