1/* 2 * ProFTPD - mod_auth_otp 3 * Copyright (c) 2015-2017 TJ Saunders 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. 18 * 19 * As a special exemption, TJ Saunders and other respective copyright holders 20 * give permission to link this program with OpenSSL, and distribute the 21 * resulting executable, without including the source code for OpenSSL in the 22 * source distribution. 23 */ 24 25#ifndef MOD_AUTH_OTP_H 26#define MOD_AUTH_OTP_H 27 28#include "conf.h" 29#include "privs.h" 30 31/* Define if you have OpenSSL with SHA256 support. */ 32#undef HAVE_SHA256_OPENSSL 33 34/* Define if you have OpenSSL with SHA512 support. */ 35#undef HAVE_SHA512_OPENSSL 36 37/* Define if you have mod_sftp support. */ 38#undef HAVE_SFTP 39 40#define MOD_AUTH_OTP_VERSION "mod_auth_otp/0.2" 41 42/* Make sure the version of proftpd is as necessary. */ 43#if PROFTPD_VERSION_NUMBER < 0x0001030402 44# error "ProFTPD 1.3.4rc2 or later required" 45#endif 46 47#include <openssl/conf.h> 48#include <openssl/evp.h> 49#include <openssl/hmac.h> 50#include <openssl/err.h> 51#include <openssl/rand.h> 52 53/* Define if you have the LibreSSL library. */ 54#if defined(LIBRESSL_VERSION_NUMBER) 55# define HAVE_LIBRESSL 1 56#endif 57 58/* mod_auth_otp option flags */ 59 60/* Miscellaneous */ 61extern int auth_otp_logfd; 62extern pool *auth_otp_pool; 63extern unsigned long auth_otp_opts; 64 65/* Supported OTP algorithms */ 66#define AUTH_OTP_ALGO_HOTP 1 67#define AUTH_OTP_ALGO_TOTP_SHA1 2 68#define AUTH_OTP_ALGO_TOTP_SHA256 3 69#define AUTH_OTP_ALGO_TOTP_SHA512 4 70 71#endif 72