summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Amelkin <alexander@amelkin.msk.ru>2021-04-21 13:26:27 +0300
committerGitHub <noreply@github.com>2021-04-21 13:26:27 +0300
commit5958d09ca48bedc746267be9803630819c0eb8d8 (patch)
tree85a50df918ae59f2941682fb6c6c5e12baeb039a
parentb9b81bfe0e61522379e36a8eb810a1bc43525e28 (diff)
parent6b1ce6c1ac34c567d594b24f03ddb43911284f1a (diff)
downloadipmitool-bugfix/280-fix-psu-inactive-offset.tar.gz
Merge branch 'master' into bugfix/280-fix-psu-inactive-offsetbugfix/280-fix-psu-inactive-offset
-rw-r--r--.github/workflows/ci.yml15
-rw-r--r--src/plugins/bmc/bmc.c11
-rw-r--r--src/plugins/free/free.c14
-rw-r--r--src/plugins/lanplus/lanplus.c2
-rw-r--r--src/plugins/lanplus/lanplus_crypt.c32
-rw-r--r--src/plugins/lipmi/lipmi.c12
6 files changed, 46 insertions, 40 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 55ff479..fdbab0c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,5 +1,5 @@
# vi: set et ts=2 sw=2 :
-name: C/C++ CI
+name: build
on:
push:
@@ -8,10 +8,10 @@ on:
branches: [ master ]
jobs:
- ubuntu:
+ linux:
strategy:
matrix:
- os: [ ubuntu-16.04, ubuntu-18.04 ]
+ os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04 ]
runs-on: ${{ matrix.os }}
steps:
- name: install dependencies
@@ -24,17 +24,12 @@ jobs:
libtool \
make \
wget
-# TODO: Add ubuntu-20.04 to the matrix.os list and fix the build
-# - name: install extra dependencies
-# # In Ubuntu 20.04 some crucial development headers/libraries
-# # have been moved from libc6-dev to musl-dev
-# if: matrix.os == 'ubuntu-20.04'
-# run: sudo apt install musl-dev
- name: install extra libraries
# This build job tries to verify as much of ipmitool code
# as possible, hence these libraries. They aren't usually
# needed for normal user builds:
run: |
+ sudo apt update
sudo apt install \
libsystemd-dev \
libreadline-dev \
@@ -50,7 +45,6 @@ jobs:
./configure --enable-intf-dummy \
--enable-intf-dbus \
--enable-intf-usb \
- --enable-intf-bmc \
--enable-intf-free
- name: make
run: make
@@ -60,7 +54,6 @@ jobs:
run: make distcheck
macos-catalina:
-
runs-on: macos-10.15
steps:
diff --git a/src/plugins/bmc/bmc.c b/src/plugins/bmc/bmc.c
index b88b077..eee6936 100644
--- a/src/plugins/bmc/bmc.c
+++ b/src/plugins/bmc/bmc.c
@@ -68,11 +68,12 @@ static struct ipmi_rs *ipmi_bmc_send_cmd_putmsg(struct ipmi_intf *intf,
#define MESSAGE_BUFSIZE 1024
struct ipmi_intf ipmi_bmc_intf = {
- name: "bmc",
- desc: "IPMI v2.0 BMC interface",
- open: ipmi_bmc_open,
- close: ipmi_bmc_close,
- sendrecv: ipmi_bmc_send_cmd};
+ .name = "bmc",
+ .desc = "IPMI v2.0 BMC interface",
+ .open = ipmi_bmc_open,
+ .close = ipmi_bmc_close,
+ .sendrecv = ipmi_bmc_send_cmd
+};
void
ipmi_bmc_close(struct ipmi_intf *intf)
diff --git a/src/plugins/free/free.c b/src/plugins/free/free.c
index 96fc9ad..832f29b 100644
--- a/src/plugins/free/free.c
+++ b/src/plugins/free/free.c
@@ -63,8 +63,6 @@ extern int verbose;
static int ipmi_free_open(struct ipmi_intf * intf)
{
- int kcs_ret = -1, ssif_ret = -1;
-
if (getuid() != 0) {
fprintf(stderr, "Permission denied, must be root\n");
return -1;
@@ -310,11 +308,11 @@ static struct ipmi_rs * ipmi_free_send_cmd(struct ipmi_intf * intf, struct ipmi_
}
struct ipmi_intf ipmi_free_intf = {
- name: "free",
- desc: "FreeIPMI IPMI Interface",
- open: ipmi_free_open,
- close: ipmi_free_close,
- sendrecv: ipmi_free_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "free",
+ .desc = "FreeIPMI IPMI Interface",
+ .open = ipmi_free_open,
+ .close = ipmi_free_close,
+ .sendrecv = ipmi_free_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};
diff --git a/src/plugins/lanplus/lanplus.c b/src/plugins/lanplus/lanplus.c
index 253f769..ed41380 100644
--- a/src/plugins/lanplus/lanplus.c
+++ b/src/plugins/lanplus/lanplus.c
@@ -741,8 +741,6 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
return (struct ipmi_rs *)1;
};
- uint8_t target_cmd = entry->req.msg.target_cmd;
-
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
if (entry->bridging_level) {
diff --git a/src/plugins/lanplus/lanplus_crypt.c b/src/plugins/lanplus/lanplus_crypt.c
index 145c880..b4d677b 100644
--- a/src/plugins/lanplus/lanplus_crypt.c
+++ b/src/plugins/lanplus/lanplus_crypt.c
@@ -84,12 +84,16 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
-#ifdef HAVE_CRYPTO_SHA256
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
-#endif /* HAVE_CRYPTO_SHA256 */
);
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
bufferLength =
@@ -251,12 +255,16 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
return 1;
/* We don't yet support other algorithms */
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
-#ifdef HAVE_CRYPTO_SHA256
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
-#endif /* HAVE_CRYPTO_SHA256 */
);
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
}
bufferLength =
@@ -417,12 +425,16 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
}
/* We don't yet support other algorithms */
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
-#ifdef HAVE_CRYPTO_SHA256
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
-#endif /* HAVE_CRYPTO_SHA256 */
);
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rc */
@@ -539,12 +551,16 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
return 0;
/* We don't yet support other algorithms */
+#ifdef HAVE_CRYPTO_SHA256 // assert() is a macro, must not put #ifdef inside it
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
-#ifdef HAVE_CRYPTO_SHA256
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA256)
-#endif /* HAVE_CRYPTO_SHA256 */
);
+#else
+ assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
+ || (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
+ );
+#endif /* HAVE_CRYPTO_SHA256 */
input_buffer_length =
16 + /* Rm */
diff --git a/src/plugins/lipmi/lipmi.c b/src/plugins/lipmi/lipmi.c
index fa7845d..f3db7ab 100644
--- a/src/plugins/lipmi/lipmi.c
+++ b/src/plugins/lipmi/lipmi.c
@@ -119,11 +119,11 @@ static struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi
}
struct ipmi_intf ipmi_lipmi_intf = {
- name: "lipmi",
- desc: "Solaris x86 LIPMI Interface",
- open: ipmi_lipmi_open,
- close: ipmi_lipmi_close,
- sendrecv: ipmi_lipmi_send_cmd,
- target_addr: IPMI_BMC_SLAVE_ADDR,
+ .name = "lipmi",
+ .desc = "Solaris x86 LIPMI Interface",
+ .open = ipmi_lipmi_open,
+ .close = ipmi_lipmi_close,
+ .sendrecv = ipmi_lipmi_send_cmd,
+ .target_addr = IPMI_BMC_SLAVE_ADDR,
};