Make OPENSSL_cleanse available to sha1 too
This commit is contained in:
parent
84a07dde15
commit
8d33413276
16
sha/sha1.c
16
sha/sha1.c
@ -61,6 +61,22 @@
|
||||
|
||||
#include <sha.h>
|
||||
|
||||
/* mem_clr.c */
|
||||
unsigned static char cleanse_ctr = 0;
|
||||
static void OPENSSL_cleanse(void *ptr, size_t len)
|
||||
{
|
||||
unsigned char *p = ptr;
|
||||
size_t loop = len, ctr = cleanse_ctr;
|
||||
while (loop--) {
|
||||
*(p++) = (unsigned char)ctr;
|
||||
ctr += (17 + ((size_t)p & 0xF));
|
||||
}
|
||||
p = memchr(ptr, (unsigned char)ctr, len);
|
||||
if (p)
|
||||
ctr += (63 + (size_t)p);
|
||||
cleanse_ctr = (unsigned char)ctr;
|
||||
}
|
||||
|
||||
#define DATA_ORDER_IS_BIG_ENDIAN
|
||||
|
||||
#define SHA_1
|
||||
|
@ -10,8 +10,8 @@
|
||||
# include "sha.h"
|
||||
|
||||
/* mem_clr.c */
|
||||
unsigned char cleanse_ctr = 0;
|
||||
void OPENSSL_cleanse(void *ptr, size_t len)
|
||||
unsigned static char cleanse_ctr = 0;
|
||||
static void OPENSSL_cleanse(void *ptr, size_t len)
|
||||
{
|
||||
unsigned char *p = ptr;
|
||||
size_t loop = len, ctr = cleanse_ctr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user