/* * OpenVPN -- An application to securely tunnel IP networks * over a single TCP/UDP port, with support for SSL/TLS-based * session authentication and key exchange, * packet encryption, packet authentication, and * packet compression. * * Copyright (C) 2002-2010 OpenVPN Technologies, Inc. * Copyright (C) 2010 Fox Crypto B.V. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 * as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING included with this * distribution); if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file Data Channel Cryptography SSL library-specific backend interface */ #ifndef CRYPTO_BACKEND_H_ #define CRYPTO_BACKEND_H_ #include "config.h" #ifdef USE_OPENSSL #include "crypto_openssl.h" #endif #include "basic.h" /* * * Random number functions, used in cases where we want * reasonably strong cryptographic random number generation * without depleting our entropy pool. Used for random * IV values and a number of other miscellaneous tasks. * */ /** * Wrapper for secure random number generator. Retrieves len bytes of random * data, and places it in output. * * @param output Output buffer * @param len Length of the output buffer, in bytes * * @return \c 1 on success, \c 0 on failure */ int rand_bytes (uint8_t *output, int len); #endif /* CRYPTO_BACKEND_H_ */