| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | * Portions Copyright 2012-2015 ForgeRock AS. |
| | | * Portions Copyright 2012-2016 ForgeRock AS. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | */ |
| | | public final class SASLByteChannel implements ConnectionSecurityProvider |
| | | { |
| | | |
| | | /** Private implementation. */ |
| | | private final class ByteChannelImpl implements ByteChannel |
| | | { |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void close() throws IOException |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isOpen() |
| | | { |
| | | return saslContext != null; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int read(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int write(final ByteBuffer unwrappedData) throws IOException |
| | | { |
| | |
| | | return bytesWritten; |
| | | } |
| | | |
| | | |
| | | |
| | | /** Attempt to read and unwrap the next SASL packet. */ |
| | | private int doRecvAndUnwrap() throws IOException |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Return a SASL byte channel instance created using the specified parameters. |
| | | * |
| | |
| | | return new SASLByteChannel(c, name, context); |
| | | } |
| | | |
| | | |
| | | |
| | | private final String name; |
| | | private final ByteChannel channel; |
| | | private final ByteChannelImpl pimpl = new ByteChannelImpl(); |
| | |
| | | private final Object readLock = new Object(); |
| | | private final Object writeLock = new Object(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Create a SASL byte channel with the specified parameters that is capable of |
| | | * processing a confidentiality/integrity SASL connection. |
| | |
| | | sendWrappedBuffer = ByteBuffer.allocate(sendUnwrappedBufferSize + 64); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ByteChannel getChannel() |
| | | { |
| | | return pimpl; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public Certificate[] getClientCertificateChain() |
| | | { |
| | | return new Certificate[0]; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public String getName() |
| | | { |
| | | return name; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public int getSSF() |
| | | { |
| | | return saslContext.getSSF(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure() |
| | | { |
| | | return true; |
| | | } |
| | | |
| | | } |