new package: ipmitool

Can be used only for remote hosts as android devices doesn't support IPMI.
Request: https://github.com/termux/unstable-packages/issues/46
This commit is contained in:
Leonid Pliushch 2019-06-16 14:55:16 +03:00
parent 7f69c5eca0
commit 6e8ddec3f4
3 changed files with 208 additions and 0 deletions

View File

@ -0,0 +1,13 @@
TERMUX_PKG_HOMEPAGE=http://ipmitool.sourceforge.net
TERMUX_PKG_DESCRIPTION="Command-line interface to IPMI-enabled devices"
TERMUX_PKG_LICENSE="BSD"
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com>"
TERMUX_PKG_VERSION=1.8.18
TERMUX_PKG_REVISION=5
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/project/ipmitool/ipmitool/$TERMUX_PKG_VERSION/ipmitool-$TERMUX_PKG_VERSION.tar.bz2
TERMUX_PKG_SHA256=0c1ba3b1555edefb7c32ae8cd6a3e04322056bc087918f07189eeedfc8b81e01
TERMUX_PKG_DEPENDS="ncurses, openssl, readline"
termux_step_pre_configure() {
export LIBS="-llog"
}

View File

@ -0,0 +1,106 @@
diff -uNr ipmitool-1.8.18/lib/ipmi_sel.c ipmitool-1.8.18.mod/lib/ipmi_sel.c
--- ipmitool-1.8.18/lib/ipmi_sel.c 2016-10-06 07:14:42.000000000 +0300
+++ ipmitool-1.8.18.mod/lib/ipmi_sel.c 2019-02-01 02:14:57.521358035 +0200
@@ -2457,18 +2457,18 @@
/* evt.sel_type.standard_type.timestamp; */
/* skip timestamp */
- cursor = index((const char *)cursor, ';');
+ cursor = strchr((const char *)cursor, ';');
cursor++;
/* FIXME: parse originator */
evt.sel_type.standard_type.gen_id = 0x0020;
/* skip originator info */
- cursor = index((const char *)cursor, ';');
+ cursor = strchr((const char *)cursor, ';');
cursor++;
/* Get sensor type */
- cursor = index((const char *)cursor, '(');
+ cursor = strchr((const char *)cursor, '(');
cursor++;
errno = 0;
@@ -2479,7 +2479,7 @@
status = (-1);
break;
}
- cursor = index((const char *)cursor, ',');
+ cursor = strchr((const char *)cursor, ',');
cursor++;
errno = 0;
@@ -2492,7 +2492,7 @@
}
/* skip to event type info */
- cursor = index((const char *)cursor, ':');
+ cursor = strchr((const char *)cursor, ':');
cursor++;
errno = 0;
@@ -2505,7 +2505,7 @@
}
/* skip to event dir info */
- cursor = index((const char *)cursor, '(');
+ cursor = strchr((const char *)cursor, '(');
cursor++;
if (*cursor == 'a') {
evt.sel_type.standard_type.event_dir = 0;
@@ -2513,7 +2513,7 @@
evt.sel_type.standard_type.event_dir = 1;
}
/* skip to data info */
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
if (evt.sel_type.standard_type.sensor_type == 0xF0) {
@@ -2532,7 +2532,7 @@
}
/* Get to previous state */
- cursor = index((const char *)cursor, 'M');
+ cursor = strchr((const char *)cursor, 'M');
cursor++;
/* Set previous state */
@@ -2546,7 +2546,7 @@
}
/* Get to current state */
- cursor = index((const char *)cursor, 'M');
+ cursor = strchr((const char *)cursor, 'M');
cursor++;
/* Set current state */
@@ -2560,7 +2560,7 @@
}
/* skip to cause */
- cursor = index((const char *)cursor, '=');
+ cursor = strchr((const char *)cursor, '=');
cursor++;
errno = 0;
evt.sel_type.standard_type.event_data[1] |=
@@ -2579,7 +2579,7 @@
status = (-1);
break;
}
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
errno = 0;
@@ -2591,7 +2591,7 @@
break;
}
- cursor = index((const char *)cursor, ' ');
+ cursor = strchr((const char *)cursor, ' ');
cursor++;
errno = 0;

View File

@ -0,0 +1,89 @@
diff -urNp old/src/plugins/lanplus/lanplus_crypt_impl.c new/src/plugins/lanplus/lanplus_crypt_impl.c
--- old/src/plugins/lanplus/lanplus_crypt_impl.c 2016-05-28 10:20:20.000000000 +0200
+++ new/src/plugins/lanplus/lanplus_crypt_impl.c 2017-02-21 10:50:21.634873466 +0100
@@ -164,10 +164,10 @@ lanplus_encrypt_aes_cbc_128(const uint8_
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_EncryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_EncryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
*bytes_written = 0;
@@ -191,7 +191,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if(!EVP_EncryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if(!EVP_EncryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
*bytes_written = 0;
@@ -201,7 +201,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_
{
uint32_t tmplen;
- if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if(!EVP_EncryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
*bytes_written = 0;
return; /* Error */
@@ -210,7 +210,8 @@ lanplus_encrypt_aes_cbc_128(const uint8_
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
}
}
}
@@ -239,10 +240,10 @@ lanplus_decrypt_aes_cbc_128(const uint8_
uint8_t * output,
uint32_t * bytes_written)
{
- EVP_CIPHER_CTX ctx;
- EVP_CIPHER_CTX_init(&ctx);
- EVP_DecryptInit_ex(&ctx, EVP_aes_128_cbc(), NULL, key, iv);
- EVP_CIPHER_CTX_set_padding(&ctx, 0);
+ EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new();
+ EVP_CIPHER_CTX_init(ctx);
+ EVP_DecryptInit_ex(ctx, EVP_aes_128_cbc(), NULL, key, iv);
+ EVP_CIPHER_CTX_set_padding(ctx, 0);
if (verbose >= 5)
@@ -266,7 +267,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
- if (!EVP_DecryptUpdate(&ctx, output, (int *)bytes_written, input, input_length))
+ if (!EVP_DecryptUpdate(ctx, output, (int *)bytes_written, input, input_length))
{
/* Error */
lprintf(LOG_DEBUG, "ERROR: decrypt update failed");
@@ -277,7 +278,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_
{
uint32_t tmplen;
- if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (int *)&tmplen))
+ if (!EVP_DecryptFinal_ex(ctx, output + *bytes_written, (int *)&tmplen))
{
char buffer[1000];
ERR_error_string(ERR_get_error(), buffer);
@@ -290,7 +291,8 @@ lanplus_decrypt_aes_cbc_128(const uint8_
{
/* Success */
*bytes_written += tmplen;
- EVP_CIPHER_CTX_cleanup(&ctx);
+ EVP_CIPHER_CTX_cleanup(ctx);
+ EVP_CIPHER_CTX_free(ctx);
}
}