Skip to content

Commit

Permalink
Merge pull request #173 from julek-wolfssl/ipmitool
Browse files Browse the repository at this point in the history
Add ipmitool patch
  • Loading branch information
dgarske authored Jun 4, 2024
2 parents a0819e5 + 417a462 commit cee6ef6
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 0 deletions.
90 changes: 90 additions & 0 deletions ipmitool/2020-02-13-c3939dac2c060651361fc71516806f9ab8c38901.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From b64f73955e22975e92ead9f3427ead30928cfbac Mon Sep 17 00:00:00 2001
From: Juliusz Sosinowicz <juliusz@wolfssl.com>
Date: Tue, 4 Jun 2024 15:33:36 +0200
Subject: [PATCH] Patch for wolfSSL

Compile wolfSSL with:
./configure --enable-all
make
make install

Compile pam-ipmi with:
patch -p1 < <path/to/this/patch>
autoreconf -if
./configure --with-wolfssl=/usr/local
make
---
configure.ac | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 50 insertions(+)

diff --git a/configure.ac b/configure.ac
index adf9bd7..21b9c61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -176,6 +176,54 @@ AC_ARG_ENABLE([internal-md5],
[xenable_internal_md5=$enableval],
[xenable_internal_md5=no])

+AC_ARG_WITH([wolfssl],
+ [AS_HELP_STRING([--with-wolfssl=PATH],[wolfSSL prefix])],
+ [WOLFSSL_PREFIX=$withval],
+ [WOLFSSL_PREFIX="no"])
+
+if test "x$WOLFSSL_PREFIX" != "xno"; then
+
+CFLAGS="$CFLAGS -I$WOLFSSL_PREFIX/include -I$WOLFSSL_PREFIX/include/wolfssl -DEXTERNAL_OPTS_OPENVPN"
+AC_SUBST(CFLAGS)
+
+AC_CHECK_LIB([wolfssl], [wolfSSL_EVP_aes_128_cbc],
+ [if test "x$xenable_internal_md5" != "xyes"; then
+ have_crypto=yes; LIBS="$LIBS -lwolfssl"
+ fi],
+ [have_crypto=no], [-lwolfssl])
+
+AC_CHECK_LIB([wolfssl], [wolfSSL_EVP_sha256],
+ [if test "x$xenable_internal_sha256" != "xyes"; then
+ if test "x$have_crypto" != "xyes"; then
+ LIBS="$LIBS -lwolfssl"
+ have_sha256=yes
+ fi
+ AC_DEFINE(HAVE_CRYPTO_SHA256, [1], [Define to 1 if wolfSSL supports SHA256.])
+ fi],
+ [], [-lwolfssl])
+
+AC_CHECK_LIB([wolfssl], [wolfSSL_MD5_Init],
+ [if test "x$xenable_internal_md5" != "xyes"; then
+ if test "x$have_crypto" != "xyes"; then
+ LIBS="$LIBS -lwolfssl"
+ have_md5=yes
+ fi
+ AC_DEFINE(HAVE_CRYPTO_MD5, [1], [Define to 1 if wolfSSL supports MD5.])
+ fi],
+ [], [-lwolfssl])
+
+AC_CHECK_LIB([wolfssl], [wolfSSL_MD2_Init],
+ [if test "x$xenable_internal_md5" != "xyes"; then
+ if test "x$have_crypto" != "xyes" && test "x$have_md5" != "xyes"; then
+ LIBS="$LIBS -lwolfssl"
+ have_md2=yes
+ fi
+ AC_DEFINE(HAVE_CRYPTO_MD2, [1], [Define to 1 if wolfSSL supports MD2.])
+ fi],
+ [], [-lwolfssl])
+
+else dnl fallback on openssl
+
AC_CHECK_LIB([crypto], [EVP_aes_128_cbc],
[if test "x$xenable_internal_md5" != "xyes"; then
have_crypto=yes; LIBS="$LIBS -lcrypto"
@@ -212,6 +260,8 @@ AC_CHECK_LIB([crypto], [MD2_Init],
fi],
[], [-lcrypto])

+fi
+
dnl check for libsystemd in case dbus-intf is requested
AC_CHECK_LIB([systemd], [sd_bus_default],
[
--
2.34.1

8 changes: 8 additions & 0 deletions ipmitool/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This folder contains patches for ipmitool to work with wolfSSL. Patches make it
easier to add support for newer versions of a target library. The format of
the patch names is:
<year>-<month>-<day>-<commit that the patch was implemented and tested on>.patch
The date in the patch name corresponds to the date of the commit that the
patch was implemented and tested on to make choosing the appropriate patch
easier. Instructions for applying each patch are included in the patch commit
message.

0 comments on commit cee6ef6

Please sign in to comment.