1 /*
2  * Copyright (C) Internet Systems Consortium, Inc. ("ISC")
3  *
4  * SPDX-License-Identifier: MPL-2.0
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0. If a copy of the MPL was not distributed with this
8  * file, you can obtain one at https://mozilla.org/MPL/2.0/.
9  *
10  * See the COPYRIGHT file distributed with this work for additional
11  * information regarding copyright ownership.
12  */
13 
14 #include <openssl/crypto.h>
15 
16 #include <isc/safe.h>
17 
18 int
isc_safe_memequal(const void * s1,const void * s2,size_t len)19 isc_safe_memequal(const void *s1, const void *s2, size_t len) {
20 	return (!CRYPTO_memcmp(s1, s2, len));
21 }
22 
23 void
isc_safe_memwipe(void * ptr,size_t len)24 isc_safe_memwipe(void *ptr, size_t len) {
25 	OPENSSL_cleanse(ptr, len);
26 }
27