View Javadoc
1   package org.metricshub.ipmi.core.sm.events;
2   
3   /*-
4    * ╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲
5    * IPMI Java Client
6    * ჻჻჻჻჻჻
7    * Copyright 2023 Verax Systems, MetricsHub
8    * ჻჻჻჻჻჻
9    * This program is free software: you can redistribute it and/or modify
10   * it under the terms of the GNU Lesser General Public License as
11   * published by the Free Software Foundation, either version 3 of the
12   * License, or (at your option) any later version.
13   *
14   * This program is distributed in the hope that it will be useful,
15   * but WITHOUT ANY WARRANTY; without even the implied warranty of
16   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17   * GNU General Lesser Public License for more details.
18   *
19   * You should have received a copy of the GNU General Lesser Public
20   * License along with this program.  If not, see
21   * <http://www.gnu.org/licenses/lgpl-3.0.html>.
22   * ╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱╲╱
23   */
24  
25  import org.metricshub.ipmi.core.coding.commands.PrivilegeLevel;
26  import org.metricshub.ipmi.core.coding.commands.session.GetChannelAuthenticationCapabilitiesResponseData;
27  import org.metricshub.ipmi.core.coding.security.CipherSuite;
28  import org.metricshub.ipmi.core.sm.StateMachine;
29  import org.metricshub.ipmi.core.sm.states.OpenSessionComplete;
30  import org.metricshub.ipmi.core.sm.states.Rakp1Waiting;
31  
32  /**
33   * Performs transition from {@link OpenSessionComplete} to {@link Rakp1Waiting}.
34   *
35   * @see StateMachine
36   */
37  public class OpenSessionAck extends Default {
38  
39  	private int managedSystemSessionId;
40  	private String username;
41  	private byte[] password;
42  	private byte[] bmcKey;
43  
44  	/**
45  	 * Provides data required to send RAKP Message 1.
46  	 *
47  	 * @param cipherSuite
48  	 *        - {@link CipherSuite} containing authentication,
49  	 *        confidentiality and integrity algorithms for this session.
50  	 * @param sequenceNumber
51  	 *        - a sequence number for the message
52  	 * @param managedSystemSessionId
53  	 *        - The Managed System's Session ID for this session. Must be as
54  	 *        returned by the Managed System in the Open Session Response
55  	 *        message.
56  	 * @param privilegeLevel
57  	 *        - Requested Maximum {@link PrivilegeLevel}
58  	 * @param username
59  	 *        - ASCII character Name that the user at the Remote Console
60  	 *        wishes to assume for this session. It's length cannot exceed
61  	 *        16.
62  	 * @param password
63  	 *        - password matching username, as sent to the BMC
64  	 * @param bmcKey
65  	 *        - BMC specific key. Should be null if Get Channel
66  	 *        Authentication Capabilities Response indicated that Kg is
67  	 *        disabled which means that 'one-key' logins are being used (
68  	 *        {@link GetChannelAuthenticationCapabilitiesResponseData#isKgEnabled()}
69  	 *        == false)
70  	 */
71  	public OpenSessionAck(CipherSuite cipherSuite, PrivilegeLevel privilegeLevel, int sequenceNumber,
72  			int managedSystemSessionId, String username, byte[] password, byte[] bmcKey) {
73  		super(cipherSuite, sequenceNumber, privilegeLevel);
74  		this.managedSystemSessionId = managedSystemSessionId;
75  		this.username = username;
76  		this.password = password;
77  		this.bmcKey = bmcKey;
78  	}
79  
80  	public int getManagedSystemSessionId() {
81  		return managedSystemSessionId;
82  	}
83  
84  	public String getUsername() {
85  		return username;
86  	}
87  
88  	public byte[] getPassword() {
89  		return password;
90  	}
91  
92  	public byte[] getBmcKey() {
93  		return bmcKey;
94  	}
95  }