mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-07-01 18:23:36 +00:00
Compare commits
5 Commits
IPMITOOL_1
...
bugfix/fix
Author | SHA1 | Date | |
---|---|---|---|
cac593b83d | |||
8554e19e68 | |||
e6632dcf43 | |||
692a357808 | |||
87fc969e45 |
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@ -1,5 +1,5 @@
|
|||||||
# vi: set et ts=2 sw=2 :
|
# vi: set et ts=2 sw=2 :
|
||||||
name: C/C++ CI
|
name: build
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@ -8,10 +8,10 @@ on:
|
|||||||
branches: [ master ]
|
branches: [ master ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
ubuntu:
|
linux:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-16.04, ubuntu-18.04 ]
|
os: [ ubuntu-16.04, ubuntu-18.04, ubuntu-20.04 ]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: install dependencies
|
- name: install dependencies
|
||||||
@ -24,17 +24,12 @@ jobs:
|
|||||||
libtool \
|
libtool \
|
||||||
make \
|
make \
|
||||||
wget
|
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
|
- name: install extra libraries
|
||||||
# This build job tries to verify as much of ipmitool code
|
# This build job tries to verify as much of ipmitool code
|
||||||
# as possible, hence these libraries. They aren't usually
|
# as possible, hence these libraries. They aren't usually
|
||||||
# needed for normal user builds:
|
# needed for normal user builds:
|
||||||
run: |
|
run: |
|
||||||
|
sudo apt update
|
||||||
sudo apt install \
|
sudo apt install \
|
||||||
libsystemd-dev \
|
libsystemd-dev \
|
||||||
libreadline-dev \
|
libreadline-dev \
|
||||||
@ -50,7 +45,6 @@ jobs:
|
|||||||
./configure --enable-intf-dummy \
|
./configure --enable-intf-dummy \
|
||||||
--enable-intf-dbus \
|
--enable-intf-dbus \
|
||||||
--enable-intf-usb \
|
--enable-intf-usb \
|
||||||
--enable-intf-bmc \
|
|
||||||
--enable-intf-free
|
--enable-intf-free
|
||||||
- name: make
|
- name: make
|
||||||
run: make
|
run: make
|
||||||
@ -60,7 +54,6 @@ jobs:
|
|||||||
run: make distcheck
|
run: make distcheck
|
||||||
|
|
||||||
macos-catalina:
|
macos-catalina:
|
||||||
|
|
||||||
runs-on: macos-10.15
|
runs-on: macos-10.15
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -68,11 +68,12 @@ static struct ipmi_rs *ipmi_bmc_send_cmd_putmsg(struct ipmi_intf *intf,
|
|||||||
#define MESSAGE_BUFSIZE 1024
|
#define MESSAGE_BUFSIZE 1024
|
||||||
|
|
||||||
struct ipmi_intf ipmi_bmc_intf = {
|
struct ipmi_intf ipmi_bmc_intf = {
|
||||||
name: "bmc",
|
.name = "bmc",
|
||||||
desc: "IPMI v2.0 BMC interface",
|
.desc = "IPMI v2.0 BMC interface",
|
||||||
open: ipmi_bmc_open,
|
.open = ipmi_bmc_open,
|
||||||
close: ipmi_bmc_close,
|
.close = ipmi_bmc_close,
|
||||||
sendrecv: ipmi_bmc_send_cmd};
|
.sendrecv = ipmi_bmc_send_cmd
|
||||||
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
ipmi_bmc_close(struct ipmi_intf *intf)
|
ipmi_bmc_close(struct ipmi_intf *intf)
|
||||||
|
@ -63,8 +63,6 @@ extern int verbose;
|
|||||||
|
|
||||||
static int ipmi_free_open(struct ipmi_intf * intf)
|
static int ipmi_free_open(struct ipmi_intf * intf)
|
||||||
{
|
{
|
||||||
int kcs_ret = -1, ssif_ret = -1;
|
|
||||||
|
|
||||||
if (getuid() != 0) {
|
if (getuid() != 0) {
|
||||||
fprintf(stderr, "Permission denied, must be root\n");
|
fprintf(stderr, "Permission denied, must be root\n");
|
||||||
return -1;
|
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 = {
|
struct ipmi_intf ipmi_free_intf = {
|
||||||
name: "free",
|
.name = "free",
|
||||||
desc: "FreeIPMI IPMI Interface",
|
.desc = "FreeIPMI IPMI Interface",
|
||||||
open: ipmi_free_open,
|
.open = ipmi_free_open,
|
||||||
close: ipmi_free_close,
|
.close = ipmi_free_close,
|
||||||
sendrecv: ipmi_free_send_cmd,
|
.sendrecv = ipmi_free_send_cmd,
|
||||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
.target_addr = IPMI_BMC_SLAVE_ADDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -741,8 +741,6 @@ ipmi_lan_poll_single(struct ipmi_intf * intf)
|
|||||||
return (struct ipmi_rs *)1;
|
return (struct ipmi_rs *)1;
|
||||||
};
|
};
|
||||||
|
|
||||||
uint8_t target_cmd = entry->req.msg.target_cmd;
|
|
||||||
|
|
||||||
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
|
lprintf(LOG_DEBUG+2, "IPMI Request Match found");
|
||||||
|
|
||||||
if (entry->bridging_level) {
|
if (entry->bridging_level) {
|
||||||
|
@ -84,12 +84,16 @@ lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* 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)
|
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||||
#ifdef HAVE_CRYPTO_SHA256
|
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_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 =
|
bufferLength =
|
||||||
@ -251,12 +255,16 @@ lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
|
|||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* 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)
|
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||||
#ifdef HAVE_CRYPTO_SHA256
|
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_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 =
|
bufferLength =
|
||||||
@ -417,12 +425,16 @@ lanplus_generate_rakp3_authcode(uint8_t * output_buffer,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* 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)
|
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||||
#ifdef HAVE_CRYPTO_SHA256
|
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_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 =
|
input_buffer_length =
|
||||||
16 + /* Rc */
|
16 + /* Rc */
|
||||||
@ -539,12 +551,16 @@ lanplus_generate_sik(struct ipmi_session * session, struct ipmi_intf * intf)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* We don't yet support other algorithms */
|
/* 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)
|
assert((session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_SHA1)
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_MD5)
|
||||||
#ifdef HAVE_CRYPTO_SHA256
|
|
||||||
|| (session->v2_data.auth_alg == IPMI_AUTH_RAKP_HMAC_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 =
|
input_buffer_length =
|
||||||
16 + /* Rm */
|
16 + /* Rm */
|
||||||
|
@ -119,11 +119,11 @@ static struct ipmi_rs * ipmi_lipmi_send_cmd(struct ipmi_intf * intf, struct ipmi
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct ipmi_intf ipmi_lipmi_intf = {
|
struct ipmi_intf ipmi_lipmi_intf = {
|
||||||
name: "lipmi",
|
.name = "lipmi",
|
||||||
desc: "Solaris x86 LIPMI Interface",
|
.desc = "Solaris x86 LIPMI Interface",
|
||||||
open: ipmi_lipmi_open,
|
.open = ipmi_lipmi_open,
|
||||||
close: ipmi_lipmi_close,
|
.close = ipmi_lipmi_close,
|
||||||
sendrecv: ipmi_lipmi_send_cmd,
|
.sendrecv = ipmi_lipmi_send_cmd,
|
||||||
target_addr: IPMI_BMC_SLAVE_ADDR,
|
.target_addr = IPMI_BMC_SLAVE_ADDR,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user