blob: 286de1a9485f9d704eb3f8fceadc3e937a032551 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
/**
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
#include <aws/core/platform/Security.h>
#include <string.h>
namespace Aws
{
namespace Security
{
void SecureMemClear(unsigned char *data, size_t length)
{
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__bsdi__) || defined(__DragonFly__)
memset_s(data, length, 0, length);
#else
memset(data, 0, length);
asm volatile("" : "+m" (data));
#endif
}
} // namespace Security
} // namespace Aws
|