From 9132b30b6c63eddd3c65fb215519bea148ade089 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Mon, 1 May 2006 22:28:45 +0000 Subject: [PATCH] fix cipher suite display bug --- ipmitool/lib/ipmi_lanp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ipmitool/lib/ipmi_lanp.c b/ipmitool/lib/ipmi_lanp.c index fdf9b8a..aa4a2f1 100644 --- a/ipmitool/lib/ipmi_lanp.c +++ b/ipmitool/lib/ipmi_lanp.c @@ -752,6 +752,7 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan) return -1; else if (p->data != NULL) { + unsigned char cipher_suite_count = p->data[0]; p = get_lan_param(intf, chan, IPMI_LANP_RMCP_CIPHERS); if (p == NULL) return -1; @@ -760,9 +761,8 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan) /* Now we're dangerous. There are only 15 fixed cipher suite IDs, but the spec allows for 16 in the return data.*/ - if ((p->data != NULL) && (p->data_len <= 16)) + if ((p->data != NULL) && (p->data_len <= 17)) { - unsigned char cipher_suite_count = p->data[0]; unsigned int i; for (i = 0; (i < 16) && (i < cipher_suite_count); ++i) { @@ -778,7 +778,6 @@ ipmi_lan_print(struct ipmi_intf * intf, uint8_t chan) } } - /* RMCP+ Messaging Cipher Suite Privilege Levels */ /* These are the privilege levels for the 15 fixed cipher suites */ p = get_lan_param(intf, chan, IPMI_LANP_RMCP_PRIV_LEVELS); @@ -2119,4 +2118,3 @@ ipmi_lanp_main(struct ipmi_intf * intf, int argc, char ** argv) } return rc; } -