mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 18:47:22 +00:00
allow twenty byte passwords
This commit is contained in:
parent
3d790edc6e
commit
3d4acbd829
@ -61,14 +61,14 @@ enum LANPLUS_SESSION_STATE {
|
||||
};
|
||||
|
||||
|
||||
#define IPMI_AUTHCODE_BUFFER_SIZE 16
|
||||
#define IPMI_AUTHCODE_BUFFER_SIZE 20
|
||||
#define IPMI_SIK_BUFFER_SIZE 20
|
||||
#define IPMI_KG_BUFFER_SIZE 21 /* key plus null byte */
|
||||
|
||||
struct ipmi_session {
|
||||
unsigned char hostname[64];
|
||||
unsigned char username[16];
|
||||
unsigned char authcode[IPMI_AUTHCODE_BUFFER_SIZE];
|
||||
unsigned char authcode[IPMI_AUTHCODE_BUFFER_SIZE + 1];
|
||||
unsigned char challenge[16];
|
||||
unsigned char authtype;
|
||||
unsigned char authtype_set;
|
||||
|
@ -146,11 +146,13 @@ void ipmi_intf_session_set_username(struct ipmi_intf * intf, char * username)
|
||||
void ipmi_intf_session_set_password(struct ipmi_intf * intf, char * password)
|
||||
{
|
||||
if (intf && intf->session) {
|
||||
memset(intf->session->authcode, 0, 16);
|
||||
memset(intf->session->authcode, 0, sizeof(intf->session->authcode));
|
||||
intf->session->password = 0;
|
||||
if (password) {
|
||||
intf->session->password = 1;
|
||||
memcpy(intf->session->authcode, password, min(strlen(password), 16));
|
||||
memcpy(intf->session->authcode,
|
||||
password,
|
||||
min(strlen(password), IPMI_AUTHCODE_BUFFER_SIZE));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user