mirror of
https://github.com/ipmitool/ipmitool.git
synced 2026-06-25 14:51:35 +00:00
Rewrite code with the notion that Kg is binary data, not string
- use uint8_t as the storage type
- allocate kgkey on stack
- do not treat incoming kgkey as 0-trminated string in
ipmi_intf_session_set_kgkey()
This commit is contained in:
committed by
Zdenek Styblik
parent
f9211f8ed9
commit
7f8d37493f
@@ -264,15 +264,9 @@ ipmi_intf_session_set_sol_escape_char(struct ipmi_intf * intf, char sol_escape_c
|
||||
}
|
||||
|
||||
void
|
||||
ipmi_intf_session_set_kgkey(struct ipmi_intf * intf, char * kgkey)
|
||||
ipmi_intf_session_set_kgkey(struct ipmi_intf *intf, const uint8_t *kgkey)
|
||||
{
|
||||
memset(intf->ssn_params.kg, 0, IPMI_KG_BUFFER_SIZE);
|
||||
|
||||
if (kgkey == NULL)
|
||||
return;
|
||||
|
||||
memcpy(intf->ssn_params.kg, kgkey,
|
||||
__min(strlen(kgkey), IPMI_KG_BUFFER_SIZE));
|
||||
memcpy(intf->ssn_params.kg, kgkey, IPMI_KG_BUFFER_SIZE);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user