|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* Copyright 2002-2016 The OpenSSL Project Authors. All Rights Reserved.
|
|
Packit Service |
084de1 |
*
|
|
Packit Service |
084de1 |
* Licensed under the OpenSSL license (the "License"). You may not use
|
|
Packit Service |
084de1 |
* this file except in compliance with the License. You can obtain a copy
|
|
Packit Service |
084de1 |
* in the file LICENSE in the source distribution or at
|
|
Packit Service |
084de1 |
* https://www.openssl.org/source/license.html
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
#include <string.h>
|
|
Packit Service |
084de1 |
#include <openssl/crypto.h>
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
/*
|
|
Packit Service |
084de1 |
* Pointer to memset is volatile so that compiler must de-reference
|
|
Packit Service |
084de1 |
* the pointer and can't assume that it points to any function in
|
|
Packit Service |
084de1 |
* particular (such as memset, which it then might further "optimize")
|
|
Packit Service |
084de1 |
*/
|
|
Packit Service |
084de1 |
typedef void *(*memset_t)(void *, int, size_t);
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
static volatile memset_t memset_func = memset;
|
|
Packit Service |
084de1 |
|
|
Packit Service |
084de1 |
void OPENSSL_cleanse(void *ptr, size_t len)
|
|
Packit Service |
084de1 |
{
|
|
Packit Service |
084de1 |
memset_func(ptr, 0, len);
|
|
Packit Service |
084de1 |
}
|