From 8b4345734e1b68257a08ed867699ecb3da0996eb Mon Sep 17 00:00:00 2001 From: Juliusz Sosinowicz Date: Fri, 9 Jul 2021 15:14:11 +0200 Subject: [PATCH] net-snmp support patch --- configure.ac | 34 +++++++++++++++++++++++++++++ wolfssl/openssl/compat_types.h | 39 ++++++++++++++++++++++++++++++++++ wolfssl/openssl/evp.h | 3 +++ wolfssl/openssl/hmac.h | 10 +-------- wolfssl/openssl/include.am | 1 + wolfssl/ssl.h | 1 + 6 files changed, 79 insertions(+), 9 deletions(-) create mode 100644 wolfssl/openssl/compat_types.h diff --git a/configure.ac b/configure.ac index c6eadf954..6ddc72125 100644 --- a/configure.ac +++ b/configure.ac @@ -793,6 +793,7 @@ AC_ARG_ENABLE([mcast], # HAVE_POCO_LIB # WOLFSSL_MYSQL_COMPATIBLE # web server (--enable-webserver) HAVE_WEBSERVER +# net-snmp (--enable-net-snmp) # Bind DNS compatibility Build @@ -3123,6 +3124,13 @@ AS_IF([test "x$ENABLED_XTS" = "xyes"], [AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_XTS -DWOLFSSL_AES_DIRECT"]) +# Web Server Build +AC_ARG_ENABLE([net-snmp], + [AS_HELP_STRING([--enable-net-snmp],[Enable net-snmp (default: disabled)])], + [ ENABLED_NETSNMP=$enableval ], + [ ENABLED_NETSNMP=no ] + ) + # Web Server Build AC_ARG_ENABLE([webserver], [AS_HELP_STRING([--enable-webserver],[Enable Web Server (default: disabled)])], @@ -4384,6 +4392,32 @@ then fi +if test "$ENABLED_NETSNMP" = "yes" +then + if test "x$ENABLED_OPENSSLEXTRA" = "xno" + then + ENABLED_OPENSSLEXTRA="yes" + AM_CFLAGS="-DOPENSSL_EXTRA $AM_CFLAGS" + fi + + if test "x$ENABLED_DES3" = "xno" + then + ENABLED_DES3="yes" + fi + + if test "x$ENABLED_AESCFB" = "xno" + then + ENABLED_AESCFB="yes" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AES_CFB" + fi + + if test "x$ENABLED_DTLS" = "xno" + then + ENABLED_DTLS="yes" + AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_DTLS" + fi +fi + if test "$ENABLED_SIGNAL" = "yes" then AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_SIGNAL -DWOLFSSL_AES_COUNTER -DWOLFSSL_AES_DIRECT" diff --git a/wolfssl/openssl/compat_types.h b/wolfssl/openssl/compat_types.h new file mode 100644 index 000000000..a2a73a04f --- /dev/null +++ b/wolfssl/openssl/compat_types.h @@ -0,0 +1,39 @@ +/* compat_types.h + * + * Copyright (C) 2006-2021 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL 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; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +/* + * Move types that cause cyclical dependency errors here. + */ + +#ifndef WOLFSSL_OPENSSL_COMPAT_TYPES_H_ +#define WOLFSSL_OPENSSL_COMPAT_TYPES_H_ + +#include +#include + +typedef struct WOLFSSL_HMAC_CTX { + Hmac hmac; + int type; + word32 save_ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/ + word32 save_opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; +} WOLFSSL_HMAC_CTX; + +#endif /* WOLFSSL_OPENSSL_COMPAT_TYPES_H_ */ diff --git a/wolfssl/openssl/evp.h b/wolfssl/openssl/evp.h index 4137f63c0..670a2c3e1 100644 --- a/wolfssl/openssl/evp.h +++ b/wolfssl/openssl/evp.h @@ -764,6 +764,9 @@ typedef WOLFSSL_ASN1_PCTX ASN1_PCTX; #define EVP_aes_128_cfb128 wolfSSL_EVP_aes_128_cfb128 #define EVP_aes_192_cfb128 wolfSSL_EVP_aes_192_cfb128 #define EVP_aes_256_cfb128 wolfSSL_EVP_aes_256_cfb128 +#define EVP_aes_128_cfb wolfSSL_EVP_aes_128_cfb128 +#define EVP_aes_192_cfb wolfSSL_EVP_aes_192_cfb128 +#define EVP_aes_256_cfb wolfSSL_EVP_aes_256_cfb128 #define EVP_aes_128_ofb wolfSSL_EVP_aes_128_ofb #define EVP_aes_192_ofb wolfSSL_EVP_aes_192_ofb #define EVP_aes_256_ofb wolfSSL_EVP_aes_256_ofb diff --git a/wolfssl/openssl/hmac.h b/wolfssl/openssl/hmac.h index 99b39be7f..9551fc1da 100644 --- a/wolfssl/openssl/hmac.h +++ b/wolfssl/openssl/hmac.h @@ -35,15 +35,7 @@ #include "prefix_hmac.h" #endif -#include - -typedef struct WOLFSSL_HMAC_CTX { - Hmac hmac; - int type; - word32 save_ipad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; /* same block size all*/ - word32 save_opad[WC_HMAC_BLOCK_SIZE / sizeof(word32)]; -} WOLFSSL_HMAC_CTX; - +#include #include #include diff --git a/wolfssl/openssl/include.am b/wolfssl/openssl/include.am index deeb9bdac..c4607966a 100644 --- a/wolfssl/openssl/include.am +++ b/wolfssl/openssl/include.am @@ -10,6 +10,7 @@ nobase_include_HEADERS+= \ wolfssl/openssl/buffer.h \ wolfssl/openssl/cmac.h \ wolfssl/openssl/cms.h \ + wolfssl/openssl/compat_types.h \ wolfssl/openssl/conf.h \ wolfssl/openssl/crypto.h \ wolfssl/openssl/des.h \ diff --git a/wolfssl/ssl.h b/wolfssl/ssl.h index 600a426c6..ef9c9dd49 100644 --- a/wolfssl/ssl.h +++ b/wolfssl/ssl.h @@ -87,6 +87,7 @@ #endif #elif (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)) + #include #include #include