public ByteBuffer getSecuredOutputByteBuffer() { return workerThread().getOutputBB(); }
public ByteBuffer getSecuredOutputByteBuffer() { return workerThread().getOutputBB(); }
/** * Encrypt the response and flush it using {@link OutputWriter} * @param channel {@link SelectableChannel} to flush * @param bb {@link ByteBuffer} * @return number of bytes written * @throws java.io.IOException */ public static long flushChannel(SelectableChannel channel, ByteBuffer bb) throws IOException{ WorkerThread workerThread = (WorkerThread)Thread.currentThread(); SSLEngine sslEngine = workerThread.getSSLEngine(); ByteBuffer outputBB = workerThread.getOutputBB(); return flushChannel(channel,bb,outputBB,sslEngine); }
/** * Encrypt the response and flush it using {@link OutputWriter} * @param channel {@link SelectableChannel} to flush * @param bb {@link ByteBuffer} * @return number of bytes written * @throws java.io.IOException */ public static long flushChannel(SelectableChannel channel, ByteBuffer bb) throws IOException{ WorkerThread workerThread = (WorkerThread)Thread.currentThread(); SSLEngine sslEngine = workerThread.getSSLEngine(); ByteBuffer outputBB = workerThread.getOutputBB(); return flushChannel(channel,bb,outputBB,sslEngine); }
/** * Encrypt the response and flush it using {@link OutputWriter} * @param channel {@link SelectableChannel} to flush * @param bb {@link ByteBuffer} * @return number of bytes written * @throws java.io.IOException */ public static long flushChannel(SelectableChannel channel, ByteBuffer bb) throws IOException{ WorkerThread workerThread = (WorkerThread)Thread.currentThread(); SSLEngine sslEngine = workerThread.getSSLEngine(); ByteBuffer outputBB = workerThread.getOutputBB(); return flushChannel(channel,bb,outputBB,sslEngine); }
(WorkerThread)Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer outputBB = workerThread.getOutputBB(); ByteBuffer inputBB = workerThread.getInputBB();
(WorkerThread)Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer outputBB = workerThread.getOutputBB(); ByteBuffer inputBB = workerThread.getInputBB();
(WorkerThread)Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer outputBB = workerThread.getOutputBB(); ByteBuffer inputBB = workerThread.getInputBB();
securedBB = ((WorkerThread) currentThread).getOutputBB();
private static void swapEncryptOutBuffer(final WorkerThread workerThread, final SSLAsyncOutputBuffer outputBuffer, final SSLEngine engine) { ByteBuffer tmp = allocate(engine); outputBuffer.setOutputBB(workerThread.getOutputBB()); workerThread.setOutputBB(tmp); outputBuffer.setSSLEngine(engine); }
(SSLWritePreProcessor) attributes.getAttribute(SSL_WRITE_PREPROCESSOR); if (preProcessor == null) { preProcessor = new SSLWritePreProcessor(sslEngine, workerThread.getOutputBB()); workerThread.setOutputBB(null); attributes.setAttribute(SSL_WRITE_PREPROCESSOR, preProcessor);
/** * Get the peer certificate list by initiating a new handshake. * @param key {@link SelectionKey} * @param needClientAuth * @return Object[] An array of X509Certificate. * @throws java.io.IOException */ public static Object[] doPeerCertificateChain(SelectionKey key, boolean needClientAuth) throws IOException { final WorkerThread workerThread = (WorkerThread)Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer inputBB = workerThread.getInputBB(); ByteBuffer outputBB = workerThread.getOutputBB(); SSLEngine sslEngine = workerThread.getSSLEngine(); return SSLUtils.doPeerCertificateChain((SocketChannel) key.channel(), byteBuffer, inputBB, outputBB, sslEngine, needClientAuth, InputReader.getDefaultReadTimeout()); }
(WorkerThread)Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer outputBB = workerThread.getOutputBB(); ByteBuffer inputBB = workerThread.getInputBB(); SSLEngine sslEngine = workerThread.getSSLEngine();
(WorkerThread) Thread.currentThread(); ByteBuffer byteBuffer = workerThread.getByteBuffer(); ByteBuffer outputBB = workerThread.getOutputBB(); ByteBuffer inputBB = workerThread.getInputBB(); SSLEngine sslEngine = workerThread.getSSLEngine();
sslEngine, thread.getByteBuffer(), thread.getOutputBB(), redirectPort, redirectToSecure);
private void saveSecuredBufferRemainders(SelectionKey selectionKey) { ThreadAttachment attachment = (ThreadAttachment) selectionKey.attachment(); WorkerThread workerThread = (WorkerThread) Thread.currentThread(); if (attachment == null || workerThread.getAttachment() != attachment) { Controller.logger().log(Level.FINE, "SelectionKey ThreadAttachment is NULL or doesn't " + "correspond to the current thread, when saving buffers"); return; } ByteBuffer inputBB = workerThread.getInputBB(); if (inputBB != null && inputBB.hasRemaining()) { workerThread.updateAttachment(attachment.getMode() | Mode.INPUT_BB); } else { workerThread.updateAttachment(attachment.getMode() & (Integer.MAX_VALUE ^ Mode.INPUT_BB)); } ByteBuffer outputBB = workerThread.getOutputBB(); if (outputBB != null && outputBB.hasRemaining()) { workerThread.updateAttachment(attachment.getMode() | Mode.OUTPUT_BB); } else { workerThread.updateAttachment(attachment.getMode() & (Integer.MAX_VALUE ^ Mode.OUTPUT_BB)); } }
hasHandshake = true; ByteBuffer outputBB = workerThread.getOutputBB(); outputBB.limit(outputBB.position()); } else {