01: package ch.ethz.ssh2.packets;
02:
03: import java.io.IOException;
04:
05: /**
06: * PacketUserauthBanner.
07: *
08: * @author Christian Plattner, plattner@inf.ethz.ch
09: * @version $Id: PacketUserauthFailure.java,v 1.3 2005/08/24 17:54:09 cplattne Exp $
10: */
11: public class PacketUserauthFailure {
12: byte[] payload;
13:
14: String[] authThatCanContinue;
15: boolean partialSuccess;
16:
17: public PacketUserauthFailure(String[] authThatCanContinue,
18: boolean partialSuccess) {
19: this .authThatCanContinue = authThatCanContinue;
20: this .partialSuccess = partialSuccess;
21: }
22:
23: public PacketUserauthFailure(byte payload[], int off, int len)
24: throws IOException {
25: this .payload = new byte[len];
26: System.arraycopy(payload, off, this .payload, 0, len);
27:
28: TypesReader tr = new TypesReader(payload, off, len);
29:
30: int packet_type = tr.readByte();
31:
32: if (packet_type != Packets.SSH_MSG_USERAUTH_FAILURE)
33: throw new IOException(
34: "This is not a SSH_MSG_USERAUTH_FAILURE! ("
35: + packet_type + ")");
36:
37: authThatCanContinue = tr.readNameList();
38: partialSuccess = tr.readBoolean();
39:
40: if (tr.remain() != 0)
41: throw new IOException(
42: "Padding in SSH_MSG_USERAUTH_FAILURE packet!");
43: }
44:
45: public String[] getAuthThatCanContinue() {
46: return authThatCanContinue;
47: }
48:
49: public boolean isPartialSuccess() {
50: return partialSuccess;
51: }
52: }
|