Package streamer

Examples of streamer.ByteBuffer.trimAtCursor()


        // Wide string + two wide '\0' characters
        buf.writeString(data + "\0\0", RdpConstants.CHARSET_16);

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        pushDataToOTOut(buf);

        switchOff();
    }
View Full Code Here


        // Copy subjectPublicKey subfield to separate byte buffer
        ByteBuffer subjectPublicKey = new ByteBuffer(subjectPublicKeyInfo.length);
        parser.subjectPublicKey.writeTag(subjectPublicKey);

        subjectPublicKeyInfo.unref();
        subjectPublicKey.trimAtCursor();

        // Skip tag:
        // 03 82 01 0f (tag) 00 (padding byte)
        subjectPublicKey.trimHeader(5);// FIXME: parse it properly
        // * DEBUG */System.out.println("DEBUG: subjectPublicKey:\n" +
View Full Code Here

        if (BLOCKS_OFFSET != buf.cursor)
            throw new RuntimeException("BUG: Actual offset of first byte of allocated blocks is not equal hardcoded offset. Hardcoded offset: " + BLOCKS_OFFSET
                    + ", actual offset: " + buf.cursor + ". Update hardcoded offset to match actual offset.");

        buf.cursor = blocksCursor;
        buf.trimAtCursor();

        ntlmState.authenticateMessage = buf.toByteArray();

        // Calculate and write MIC to reserved position
        ntlmState.ntlm_compute_message_integrity_check();
View Full Code Here

        writeAVPair(buf, MSV_AV_EOL, "");
        // DEBUG: put EOL 4 times, for compatibility with FreeRDP output
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        //*DEBUG*/writeAVPair(buf, MSV_AV_EOL, "");
        buf.trimAtCursor();

        authenticateTargetInfo = buf.toByteArray();
        buf.unref();

        return authenticateTargetInfo;
View Full Code Here

        buf.writeInt(0); // reserved
        buf.writeBytes(clientChallengeTimestamp); // Timestamp, 8 bytes
        buf.writeBytes(clientChallenge); // Client nonce, 8 bytes
        buf.writeInt(0); // reserved
        buf.writeBytes(authenticateTargetInfo); // Target Info block
        buf.trimAtCursor();
        byte[] bufBytes = buf.toByteArray();
        buf.unref();

        ntProofStr2 = computeNtProofStr(ntlm_v2_hash, CryptoAlgos.concatenationOf(serverChallenge, bufBytes));
View Full Code Here

        tsRequest.negoTokens.tags = new Tag[] {negoItem};

        tsRequest.writeTag(buf);

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        pushDataToOTOut(buf);

        switchOff();
    }
View Full Code Here

        // OS Version: 6.1 (Build 7601); NTLM Current Revision 15
        buf.writeBytes(new byte[] {(byte)0x06, (byte)0x01, (byte)0xb1, (byte)0x1d, (byte)0x00, (byte)0x00, (byte)0x00, (byte)0x0f});

        // Trim buffer to actual length of data written
        buf.trimAtCursor();

        return buf;
    }

    /**
 
View Full Code Here

        TSPasswordCreds tsPasswordCreds = new TSPasswordCreds("credentials");
        tsPasswordCreds.domainName.value = new ByteBuffer(ntlmState.domain.getBytes(RdpConstants.CHARSET_16));
        tsPasswordCreds.userName.value = new ByteBuffer(ntlmState.user.getBytes(RdpConstants.CHARSET_16));
        tsPasswordCreds.password.value = new ByteBuffer(ntlmState.password.getBytes(RdpConstants.CHARSET_16));
        tsPasswordCreds.writeTag(tsPasswordCredsBuf);
        tsPasswordCredsBuf.trimAtCursor();
        //* DEBUG */System.out.println("TSPasswordCreds:\n" + tsPasswordCredsBuf.dump());

        tsCredentials.credentials.value = tsPasswordCredsBuf;

        tsCredentials.writeTag(buf);
View Full Code Here

        buf.writeIntLE(4);

        // ID of chosen format
        buf.writeIntLE(textFormat.id);

        buf.trimAtCursor();

        pushDataToPad(STDOUT, buf);
    }

    /**
 
View Full Code Here

        // Message flags
        buf.writeShortLE((ok) ? ServerClipRdrChannelRouter.CB_RESPONSE_OK : ServerClipRdrChannelRouter.CB_RESPONSE_FAIL);
        // Length
        buf.writeIntLE(0);

        buf.trimAtCursor();

        pushDataToPad(STDOUT, buf);
    }

    protected void parseFormatNames(ByteBuffer buf) {
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.