1 2 package ch.ethz.ssh2.packets; 3 4 import java.io.IOException ; 5 6 12 public class PacketUserauthFailure 13 { 14 byte[] payload; 15 16 String [] authThatCanContinue; 17 boolean partialSuccess; 18 19 public PacketUserauthFailure(String [] authThatCanContinue, boolean partialSuccess) 20 { 21 this.authThatCanContinue = authThatCanContinue; 22 this.partialSuccess = partialSuccess; 23 } 24 25 public PacketUserauthFailure(byte payload[], int off, int len) throws IOException 26 { 27 this.payload = new byte[len]; 28 System.arraycopy(payload, off, this.payload, 0, len); 29 30 TypesReader tr = new TypesReader(payload, off, len); 31 32 int packet_type = tr.readByte(); 33 34 if (packet_type != Packets.SSH_MSG_USERAUTH_FAILURE) 35 throw new IOException ("This is not a SSH_MSG_USERAUTH_FAILURE! (" + packet_type + ")"); 36 37 authThatCanContinue = tr.readNameList(); 38 partialSuccess = tr.readBoolean(); 39 40 if (tr.remain() != 0) 41 throw new IOException ("Padding in SSH_MSG_USERAUTH_FAILURE packet!"); 42 } 43 44 public String [] getAuthThatCanContinue() 45 { 46 return authThatCanContinue; 47 } 48 49 public boolean isPartialSuccess() 50 { 51 return partialSuccess; 52 } 53 } 54 | Popular Tags |