Examples of SSHPacket


Examples of net.schmizz.sshj.common.SSHPacket

        }
        finishOff();
    }

    protected SSHPacket buildOpenReq() {
        return new SSHPacket(Message.CHANNEL_OPEN)
                .putString(getType())
                .putUInt32(getID())
                .putUInt32(getLocalWinSize())
                .putUInt32(getLocalMaxPacketSize());
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

        try {
            while (!isInterrupted()) {
                final int hi = getPositiveInterval();
                if (trans.isRunning()) {
                    log.info("Sending heartbeat since {} seconds elapsed", hi);
                    trans.write(new SSHPacket(Message.IGNORE));
                }
                Thread.sleep(hi * 1000);
            }
        } catch (Exception e) {
            if (isInterrupted()) {
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

    }

    @Override
    protected SSHPacket buildReq()
            throws UserAuthException {
        final SSHPacket req = putPubKey(super.buildReq());
        req.putString(hostname).putString(hostuser);
        return putSig(req);
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

        sig = Factory.Named.Util.getNames(config.getSignatureFactories());
        c2sCipher = s2cCipher = Factory.Named.Util.getNames(config.getCipherFactories());
        c2sMAC = s2cMAC = Factory.Named.Util.getNames(config.getMACFactories());
        c2sComp = s2cComp = Factory.Named.Util.getNames(config.getCompressionFactories());

        packet = new SSHPacket(Message.KEXINIT);

        // Put cookie
        packet.ensureCapacity(16);
        config.getRandomFactory().create().fill(packet.array(), packet.wpos(), 16);
        packet.wpos(packet.wpos() + 16);
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

    public List<String> getServer2ClientCompressionAlgorithms() {
        return s2cComp;
    }

    public SSHPacket getPacket() {
        return new SSHPacket(packet);
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

        this.I_C = Arrays.copyOf(I_C, I_C.length);
        sha1.init();
        initDH(dh);

        log.info("Sending SSH_MSG_KEXDH_INIT");
        trans.write(new SSHPacket(Message.KEXDH_INIT).putMPInt(dh.getE()));
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

            throws ConnectionException, TransportException {
        trans.write(newBuffer(Message.CHANNEL_FAILURE));
    }

    protected SSHPacket newBuffer(Message cmd) {
        return new SSHPacket(cmd).putUInt32(recipient);
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

    private SSHPacket checkHeaderSpace(SSHPacket buffer) {
        if (buffer.rpos() < 5) {
            log.warn("Performance cost: when sending a packet, ensure that "
                             + "5 bytes are available in front of the buffer");
            SSHPacket nb = new SSHPacket(buffer.available() + 5);
            nb.rpos(5);
            nb.wpos(5);
            nb.putBuffer(buffer);
            buffer = nb;
        }
        return buffer;
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

        }
    }

    private void respond(CharArrWrap[] userReplies)
            throws TransportException {
        final SSHPacket pkt = new SSHPacket(Message.USERAUTH_INFO_RESPONSE).putUInt32(userReplies.length);
        for (final CharArrWrap response : userReplies)
            pkt.putSensitiveString(response.arr);
        params.getTransport().write(pkt);
    }
View Full Code Here

Examples of net.schmizz.sshj.common.SSHPacket

     * Builds a {@link SSHPacket} containing the fields common to all authentication method. Method-specific fields can
     * further be put into this buffer.
     */
    protected SSHPacket buildReq()
            throws UserAuthException {
        return new SSHPacket(Message.USERAUTH_REQUEST) // SSH_MSG_USERAUTH_REQUEST
                .putString(params.getUsername()) // username goes first
                .putString(params.getNextServiceName()) // the service that we'd like on success
                .putString(name); // name of auth method
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.