comparison src/com/trilead/ssh2/packets/PacketUserauthFailure.java @ 0:0ce5cc452d02

initial version
author Carl Byington <carl@five-ten-sg.com>
date Thu, 22 May 2014 10:41:19 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:0ce5cc452d02
1
2 package com.trilead.ssh2.packets;
3
4 import java.io.IOException;
5
6 /**
7 * PacketUserauthBanner.
8 *
9 * @author Christian Plattner, plattner@trilead.com
10 * @version $Id: PacketUserauthFailure.java,v 1.1 2007/10/15 12:49:55 cplattne Exp $
11 */
12 public class PacketUserauthFailure {
13 byte[] payload;
14
15 String[] authThatCanContinue;
16 boolean partialSuccess;
17
18 public PacketUserauthFailure(String[] authThatCanContinue, boolean partialSuccess) {
19 this.authThatCanContinue = authThatCanContinue;
20 this.partialSuccess = partialSuccess;
21 }
22
23 public PacketUserauthFailure(byte payload[], int off, int len) throws IOException {
24 this.payload = new byte[len];
25 System.arraycopy(payload, off, this.payload, 0, len);
26 TypesReader tr = new TypesReader(payload, off, len);
27 int packet_type = tr.readByte();
28
29 if (packet_type != Packets.SSH_MSG_USERAUTH_FAILURE)
30 throw new IOException("This is not a SSH_MSG_USERAUTH_FAILURE! (" + packet_type + ")");
31
32 authThatCanContinue = tr.readNameList();
33 partialSuccess = tr.readBoolean();
34
35 if (tr.remain() != 0)
36 throw new IOException("Padding in SSH_MSG_USERAUTH_FAILURE packet!");
37 }
38
39 public String[] getAuthThatCanContinue() {
40 return authThatCanContinue;
41 }
42
43 public boolean isPartialSuccess() {
44 return partialSuccess;
45 }
46 }