Mercurial > hg > Applications > TreeVNC
view src/main/java/com/glavsoft/rfb/protocol/auth/RequireAuthentication.java @ 423:ffe01c959cdd
Fix LostChild for root node
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 22 Jan 2016 07:51:57 +0900 |
parents | 73abb3b86ce7 |
children |
line wrap: on
line source
package com.glavsoft.rfb.protocol.auth; import com.glavsoft.exceptions.TransportException; import com.glavsoft.rfb.CapabilityContainer; import com.glavsoft.rfb.IPasswordRetriever; import com.glavsoft.transport.Reader; import com.glavsoft.transport.Writer; public class RequireAuthentication extends AuthHandler { @Override public boolean authenticate(Reader reader, Writer writer, CapabilityContainer authCaps, IPasswordRetriever passwordRetriever) throws TransportException { byte[] headBuf = new byte[2]; reader.readBytes(headBuf); if (headBuf[1] == 2) { byte[] b = new byte[258]; reader.readBytes(b); byte[] outBuf = new byte[256]; writer.write(outBuf); writer.flush(); } else if (headBuf[1] == 23) { byte[] b = new byte[130]; reader.readBytes(b); byte[] outBuf = new byte[192]; writer.write(outBuf); writer.flush(); } return false; } @Override public SecurityType getType() { return SecurityType.REQUIRE_AUTHENTICATION; } }