Make CRYPTO_cleanse() independent of endianness.

This commit is contained in:
Richard Levitte 2002-12-03 16:06:40 +00:00
parent 7a1f92fdc3
commit 4707991520

View file

@ -68,7 +68,7 @@ void OPENSSL_cleanse(void *ptr, size_t len)
while(loop--) while(loop--)
{ {
*(p++) = cleanse_ctr; *(p++) = cleanse_ctr;
cleanse_ctr += (17 + (((unsigned char *)&p)[sizeof(unsigned char *)-1] & 0xF)); cleanse_ctr += (17 + (unsigned char)((int)p & 0xF));
} }
if(memchr(ptr, cleanse_ctr, len)) if(memchr(ptr, cleanse_ctr, len))
cleanse_ctr += 63; cleanse_ctr += 63;