Mercurial > hg > Applications > TreeVNC
view src/main/java/com/glavsoft/rfb/protocol/auth/RequireAuthentication.java @ 630:7071b01621c2 default tip
Determine ipv4 or ipv6 and fix scond display
author | riono <e165729@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 28 Apr 2020 19:49:38 +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; } }