Class IntegrityMd5_128
java.lang.Object
org.metricshub.ipmi.core.coding.security.IntegrityAlgorithm
org.metricshub.ipmi.core.coding.security.IntegrityMd5_128
MD5-128 integrity algorithm (IPMI 2.0 section 13.28.4): a plain MD5 of the password around the message,
AuthCode = MD5(password + AuthType/Format ... Next Header + password), where the password is the user's key
(Kuid) zero-padded to 20 bytes as the BMC stores it. Unlike the HMAC algorithms, it is not keyed with the Session
Integrity Key: initialize(byte[]) takes the password.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]generateAuthCode(byte[] base) Creates AuthCode field for message.Returns the name of the algorithm.intReturns the length of the authentication codebytegetCode()Returns the algorithm's ID.voidinitialize(byte[] password) Keys the algorithm with the user's password (not the Session Integrity Key), zero-padded to 20 bytes.Methods inherited from class org.metricshub.ipmi.core.coding.security.IntegrityAlgorithm
wipeKey
-
Field Details
-
ALGORITHM_NAME
- See Also:
-
-
Constructor Details
-
IntegrityMd5_128
public IntegrityMd5_128()Initiates the MD5-128 integrity algorithm.
-
-
Method Details
-
initialize
public void initialize(byte[] password) Keys the algorithm with the user's password (not the Session Integrity Key), zero-padded to 20 bytes.- Overrides:
initializein classIntegrityAlgorithm- Parameters:
password- the password of the user, as sent to the BMC; null for an empty password
-
generateAuthCode
public byte[] generateAuthCode(byte[] base) Description copied from class:IntegrityAlgorithmCreates AuthCode field for message. Synchronized: the sending, receiving and keep-alive threads share this instance and itsMac.- Overrides:
generateAuthCodein classIntegrityAlgorithm- Parameters:
base- - data starting with the AuthType/Format field up to and including the field that immediately precedes the AuthCode field- Returns:
- AuthCode field. Might be null if empty AuthCOde field is generated.
- See Also:
-
getCode
public byte getCode()Description copied from class:IntegrityAlgorithmReturns the algorithm's ID.- Specified by:
getCodein classIntegrityAlgorithm
-
getAlgorithmName
Description copied from class:IntegrityAlgorithmReturns the name of the algorithm.- Specified by:
getAlgorithmNamein classIntegrityAlgorithm- Returns:
- The algorithm name as a
String.
-
getAuthCodeLength
public int getAuthCodeLength()Description copied from class:IntegrityAlgorithmReturns the length of the authentication code- Specified by:
getAuthCodeLengthin classIntegrityAlgorithm- Returns:
- The length of the authentication code in bytes.
-