Blame lib/mem.h

Packit aea12f
/*
Packit aea12f
 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
Packit aea12f
 *
Packit aea12f
 * Author: Nikos Mavrogiannopoulos
Packit aea12f
 *
Packit aea12f
 * This file is part of GnuTLS.
Packit aea12f
 *
Packit aea12f
 * The GnuTLS is free software; you can redistribute it and/or
Packit aea12f
 * modify it under the terms of the GNU Lesser General Public License
Packit aea12f
 * as published by the Free Software Foundation; either version 2.1 of
Packit aea12f
 * the License, or (at your option) any later version.
Packit aea12f
 *
Packit aea12f
 * This library is distributed in the hope that it will be useful, but
Packit aea12f
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit aea12f
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit aea12f
 * Lesser General Public License for more details.
Packit aea12f
 *
Packit aea12f
 * You should have received a copy of the GNU Lesser General Public License
Packit aea12f
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
Packit aea12f
 *
Packit aea12f
 */
Packit aea12f
Packit aea12f
#ifndef GNUTLS_LIB_MEM_H
Packit aea12f
#define GNUTLS_LIB_MEM_H
Packit aea12f
Packit aea12f
#include <config.h>
Packit aea12f
Packit aea12f
/* this realloc function will return ptr if size==0, and
Packit aea12f
 * will free the ptr if the new allocation failed.
Packit aea12f
 */
Packit aea12f
void *gnutls_realloc_fast(void *ptr, size_t size);
Packit aea12f
Packit aea12f
void *_gnutls_calloc(size_t nmemb, size_t size);
Packit aea12f
char *_gnutls_strdup(const char *);
Packit aea12f
Packit aea12f
unsigned _gnutls_mem_is_zero(const uint8_t *ptr, unsigned size);
Packit aea12f
Packit aea12f
#define zrelease_mpi_key(mpi) if (*mpi!=NULL) { \
Packit aea12f
		_gnutls_mpi_clear(*mpi); \
Packit aea12f
		_gnutls_mpi_release(mpi); \
Packit aea12f
	}
Packit aea12f
Packit aea12f
#define zeroize_key(x, size) gnutls_memset(x, 0, size)
Packit aea12f
Packit aea12f
#define zeroize_temp_key zeroize_key
Packit aea12f
#define zrelease_temp_mpi_key zrelease_mpi_key
Packit aea12f
Packit aea12f
#endif /* GNUTLS_LIB_MEM_H */