27 Commits

Author SHA1 Message Date
Vernon Mauery
7772254b62 lanplus: Auto-select 'best' cipher suite available
Based on current crypto alogrithms, one could rank cipher suites along
these lines:

17 > 3 >> all the rest

17 and 3 are the only cipher suites that implement any sort of
confidentiality alogorithm that is secure. In addition, any hmac-md5 or
md5 integrity algorithm used in integrity is weak at best and dangerous
for authentication.

This could possibly be enabled in a simpler mechanism by simply checking
for 17 and then choosing it before falling back to 3, but the way this
is implemented, it makes it easy to change the list of acceptable
algorithms from two to three or more items.

Resolves ipmitool/ipmitool#29

Signed-off-by: Vernon Mauery <vernon.mauery@intel.com>
2018-11-01 19:29:45 +03:00
Alexander Amelkin
e9716e216d
Refactoring: optimize pointer checks
Remove all direct comparisons to 'NULL' for pointers.
Replace them with boolean-like 'if (ptr)' and 'if (!ptr)'.
This makes conditions shorter and easier to read.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 17:30:25 +03:00
Alexander Amelkin
9ecfb762bd
Refactoring: get rid of superfluous comparisons
Make code better readable by replacing `if (rsp->ccode > 0)`
and 'if (rsp->ccode != 0)' with just `if (rsp->ccode)` as
rsp->ccode is anyway an unsigned byte and can't be negative.
Also replace 'if (rsp->ccode == 0)' with 'if (!rsp->ccode)'.

All these changes make lines shorter and easier to read as
a non-zero ccode is an indication of some failure, and so !ccode
naturally reads as 'no error'.

Signed-off-by: Alexander Amelkin <alexander@amelkin.msk.ru>
2018-08-21 11:55:03 +03:00
Thorsten Horstmann
232773d171 general: Fix several misspellings
Fix misspellings found by codespell in code comments,
console output and documentation.

Resolves ipmitool/ipmitool#28
2018-08-06 15:59:06 +03:00
Zdenek Styblik
cc9a6b3964 ID:457 - Display User ID enable/disable status
Commit implements `Enable status` which shows/is in alignment with (22.27) Get
User Access Command and displays User ID Enable/Disable status of given User ID
at given channel.
2016-08-21 12:17:10 +02:00
Dmitry Bazhenov
c56b5c9667 ID:399 - Fixed channel getciphers command.
'channel getciphers' command uses wrong command-line argument
when parsing the target channel number. This patch fixes
this problem.
2015-11-06 08:53:38 +01:00
Dmitry Bazhenov
718a242205 ID:398 - Fixed channel setaccess command.
'channel setaccess' command uses wrong command-line arguments
to construct the set user access request. This patch fixes
this problem.
2015-11-06 08:52:29 +01:00
Zdenek Styblik
ffeb535db8 ID:392 - _ipmi_get_user_name() work-around for some BMCs
Commit adds a work-around for some BMCs which return ccode 0xCC when user is
disabled. However, this isn't reason to stop listing users as this ccode is
perceived as being "normal".
When 0xCC is returned, empty user name will be printed instead of bailing out.
2015-10-09 20:53:24 +02:00
Zdenek Styblik
5a30d18af2 _ipmi_set_channel_access() - zero-out variable data before use 2015-02-03 11:45:59 +01:00
Zdenek Styblik
026a8b6fce Add _ipmi_set_channel_access() function
Commit adds _ipmi_set_channel_access() function which in implementation of
(22.22) Set Channel Access Command.
2015-02-03 07:33:08 +01:00
Zdenek Styblik
6febd10121 Put functions in ipmi_channel.c in A-Z order 2015-01-17 07:11:07 +01:00
Zdenek Styblik
6b8d55d68b Re-work ccode eval in ipmi_get_channel_medium()
Commit re-works ccode eval in ipmi_get_channel_medium() as the previous one
didn't work and led to dead-code.
2015-01-16 21:05:56 +01:00
Zdenek Styblik
dab7f5bf81 Remove unused variable from ipmi_get_channel_cipher_suites()
Commit removes unused variable oem_record from ipmi_get_channel_cipher_suites().
2015-01-16 20:11:29 +01:00
Zdenek Styblik
278dc84b22 Print error message to STDERR in ipmi_channel.c
Print error message to STDERR and not STDOUT in ipmi_channel_main().
2015-01-16 20:07:26 +01:00
Zdenek Styblik
0801b4588d Hook ipmi_get_channel_medium() to new _ipmi_get_*() functions
Commit hooks ipmi_get_channel_medium() to new _ipmi_get_*() functions.
2015-01-16 20:04:31 +01:00
Zdenek Styblik
56aa025dc2 Hook ipmi_get_channel_info() to _ipmi_get_*()
Commit hooks ipmi_get_channel_info() to new _ipmi_get_*() functions.
2015-01-16 20:03:07 +01:00
Zdenek Styblik
238d3c4ea9 Add _ipmi_get_channel_access() and _ipmi_get_channel_info()
Commit adds _ipmi_get_channel_access() and _ipmi_get_channel_info() as well as
supporting structures.
2015-01-16 20:01:50 +01:00
Zdenek Styblik
69f668309b ipmi_get_user_access() - change var name 'userid' to 'user_id'
Commit changes variable/param name from 'userid' to 'user_id' in order to keep
consistency.
2015-01-13 13:36:25 +01:00
Zdenek Styblik
585cb7c83d Add documentation to 'getaccess' and 'setaccess' functions 2015-01-11 09:39:13 +01:00
Zdenek Styblik
708be8bc45 Hook ipmi_user_priv() to _ipmi_set_user_access()
Commit hooks ipmi_user_priv() to _ipmi_set_user_access(). Later got extended for
'change_priv_limit_only', because of the former.
Commit removes ipmi_user_set_userpriv(), because it's not used anywhere.
2015-01-09 12:48:35 +01:00
Zdenek Styblik
e4be291c65 Re-work 'channel getaccess' and 'channel setaccess'
Commit is a re-work of 'channel getaccess' and 'channel setaccess'. These are
using _ipmi_* now. Also, bitfields and two structs are replaced by one unified
struct.
2015-01-08 19:45:22 +01:00
Zdenek Styblik
48117f5ddf ID:355 - Fix ``ISO C forbids omitting the middle term of a ?: expression''
Commit fixes omitted middle terms of ternary expressions.
2014-12-30 08:00:23 +01:00
Zdenek Styblik
0a1f5c03e5 Replace deprecated bzero() with memset()
Commit replaces deprecated bzero() with memset().
2014-12-23 05:46:28 +01:00
Zdenek Styblik
140add9d77 Fix user input validation in Channel and User sub-commands
Commit fixes validation of user input in Channel and User sub-commands.
2014-12-22 18:21:51 +01:00
Zdenek Styblik
0562c809af Cleanup if/else in ipmi_channel_main() 2014-12-22 08:49:58 +01:00
Zdenek Styblik
a87b2ccc67 Cleanup of code formatting in ipmi_channel.c
At least a bit.
2014-12-22 07:57:18 +01:00
Petter Reinholdtsen
c18ec02f33 Move all files one level up in the file hierarcy, to avoid the useless ipmitool directory. 2014-02-05 17:30:32 +01:00