io.netty.handler.ssl.ReferenceCountedOpenSslEngine.class Maven / Gradle / Ivy
???? 2? 2io/netty/handler/ssl/ReferenceCountedOpenSslEngine javax/net/ssl/SSLEngine io/netty/util/ReferenceCounted "ReferenceCountedOpenSslEngine.java 4io/netty/handler/ssl/ReferenceCountedOpenSslEngine$2 Aio/netty/handler/ssl/ReferenceCountedOpenSslEngine$OpenSslSession
OpenSslSession Aio/netty/handler/ssl/ReferenceCountedOpenSslEngine$HandshakeState
HandshakeState 4io/netty/handler/ssl/ReferenceCountedOpenSslEngine$1 -javax/net/ssl/SSLEngineResult$HandshakeStatus javax/net/ssl/SSLEngineResult HandshakeStatus $javax/net/ssl/SSLEngineResult$Status Status logger /Lio/netty/util/internal/logging/InternalLogger; BEGIN_HANDSHAKE_ENGINE_CLOSED Ljavax/net/ssl/SSLException; HANDSHAKE_ENGINE_CLOSED RENEGOTIATION_UNSUPPORTED leakDetector $Lio/netty/util/ResourceLeakDetector; ZLio/netty/util/ResourceLeakDetector; !DEFAULT_HOSTNAME_VALIDATION_FLAGS I MAX_PLAINTEXT_LENGTH @ MAX_TLS_RECORD_OVERHEAD_LENGTH Z MAX_ENCRYPTED_PACKET_LENGTH @Z DESTROYED_UPDATER 7Ljava/util/concurrent/atomic/AtomicIntegerFieldUpdater; mLjava/util/concurrent/atomic/AtomicIntegerFieldUpdater; INVALID_CIPHER Ljava/lang/String; SSL_NULL_WITH_NULL_NULL 1 NEED_UNWRAP_OK Ljavax/net/ssl/SSLEngineResult; NEED_UNWRAP_CLOSED NEED_WRAP_OK NEED_WRAP_CLOSED CLOSED_NOT_HANDSHAKING ssl J
networkBIO certificateSet Z handshakeState CLio/netty/handler/ssl/ReferenceCountedOpenSslEngine$HandshakeState; renegotiationPending receivedShutdown destroyed leak #Lio/netty/util/ResourceLeakTracker; YLio/netty/util/ResourceLeakTracker; refCnt (Lio/netty/util/AbstractReferenceCounted;
clientAuth !Lio/netty/handler/ssl/ClientAuth; lastAccessed endPointIdentificationAlgorithm algorithmConstraints Ljava/lang/Object; sniHostNames Ljava/util/List; $Ljava/util/List;
isInboundDone outboundClosed
clientMode alloc "Lio/netty/buffer/ByteBufAllocator; engineMap 'Lio/netty/handler/ssl/OpenSslEngineMap; apn ;Lio/netty/handler/ssl/OpenSslApplicationProtocolNegotiator; rejectRemoteInitiatedRenegation session CLio/netty/handler/ssl/ReferenceCountedOpenSslEngine$OpenSslSession;
localCerts ![Ljava/security/cert/Certificate; singleSrcBuffer [Ljava/nio/ByteBuffer; singleDstBuffer keyMaterialManager 0Lio/netty/handler/ssl/OpenSslKeyMaterialManager; handshakeException %Ljavax/net/ssl/SSLHandshakeException; $assertionsDisabled n(Lio/netty/handler/ssl/ReferenceCountedOpenSslContext;Lio/netty/buffer/ByteBufAllocator;Ljava/lang/String;IZ)V java/lang/Throwable i (Ljava/lang/String;I)V g k
l NOT_STARTED n ? o > ? q 7(Lio/netty/handler/ssl/ReferenceCountedOpenSslEngine;)V g s
t F G v io/netty/handler/ssl/ClientAuth x NONE z I y { H I }???????? J : ? java/nio/ByteBuffer ? _ ` ? a ` ? io/netty/handler/ssl/OpenSsl ? ensureAvailability ()V ? ?
? ? ! ? "io/netty/util/ResourceLeakDetector ? track 7(Ljava/lang/Object;)Lio/netty/util/ResourceLeakTracker; ? ?
? ? 3io/netty/handler/ssl/ReferenceCountedOpenSslContext ? io/netty/buffer/ByteBufAllocator ? java/lang/String ? !io/netty/util/ResourceLeakTracker ? C D ? T !io/netty/util/internal/ObjectUtil ? checkNotNull 8(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object; ? ?
? ? T U ? applicationProtocolNegotiator 6()Lio/netty/handler/ssl/ApplicationProtocolNegotiator; ? ?
? ? 9io/netty/handler/ssl/OpenSslApplicationProtocolNegotiator ? X Y ? sessionContext .()Lio/netty/handler/ssl/OpenSslSessionContext; ? ?
? ? c(Lio/netty/handler/ssl/ReferenceCountedOpenSslEngine;Lio/netty/handler/ssl/OpenSslSessionContext;)V g ?
? [ \ ? isClient ()Z ? ?
? ? S = ? V W ? ? ? %getRejectRemoteInitiatedRenegotiation ? ?
? ? Z = ? keyCertChain ? ^ ? ? ] ^ ? 2()Lio/netty/handler/ssl/OpenSslKeyMaterialManager; b ?
? ? b c ? ctx ? : ? ? io/netty/internal/tcnative/SSL ? newSSL (JZ)J ? ?
? ? 9 : ? getBioNonApplicationBufferSize ()I ? ?
? ? bioNewByteBuffer (JI)J ? ?
? ? ; : ? ? }
setClientAuth $(Lio/netty/handler/ssl/ClientAuth;)V ? ?
? protocols [Ljava/lang/String; ? ? ? ? setEnabledProtocols ([Ljava/lang/String;)V ? ?
? setTlsExtHostName (JLjava/lang/String;)V ? ?
? ? freeSSL (J)V ? ?
? ? (io/netty/util/internal/PlatformDependent ? throwException (Ljava/lang/Throwable;)V ?
? cause Ljava/lang/Throwable; this 4Lio/netty/handler/ssl/ReferenceCountedOpenSslEngine; context 5Lio/netty/handler/ssl/ReferenceCountedOpenSslContext; peerHost peerPort
leakDetection &io/netty/util/AbstractReferenceCounted F ?
retain "()Lio/netty/util/ReferenceCounted;
#(I)Lio/netty/util/ReferenceCounted;
increment touch
4(Ljava/lang/Object;)Lio/netty/util/ReferenceCounted;
hint release ?
(I)Z"
# decrement getHandshakeSession ()Ljavax/net/ssl/SSLSession; L$SwitchMap$io$netty$handler$ssl$ReferenceCountedOpenSslEngine$HandshakeState [I() * ordinal, ?
-
sslPointer ()J shutdown , - 2 5java/util/concurrent/atomic/AtomicIntegerFieldUpdater4
compareAndSet (Ljava/lang/Object;II)Z67
58 %io/netty/handler/ssl/OpenSslEngineMap: remove 7(J)Lio/netty/handler/ssl/ReferenceCountedOpenSslEngine;<=;> R = @ Q = B
clearErrorD ?
?E writePlaintextData (Ljava/nio/ByteBuffer;I)I positionI ?
?J limitL ?
?M isDirectO ?
?P !io/netty/internal/tcnative/BufferR address (Ljava/nio/ByteBuffer;)JTU
SV
writeToSSL (JJI)IXY
?Z (I)Ljava/nio/Buffer;I\
?] directBuffer (I)Lio/netty/buffer/ByteBuf;_` ?aL\
?c io/netty/buffer/ByteBufe setBytes 1(ILjava/nio/ByteBuffer;)Lio/netty/buffer/ByteBuf;gh
fi
memoryAddress (Lio/netty/buffer/ByteBuf;)Jkl
?m
f sslWrote buf Lio/netty/buffer/ByteBuf; src Ljava/nio/ByteBuffer; len pos writeEncryptedData 1(Ljava/nio/ByteBuffer;I)Lio/netty/buffer/ByteBuf; bioSetByteBuffer (JJIZ)Vyz
?{
writeBytes 0(Ljava/nio/ByteBuffer;)Lio/netty/buffer/ByteBuf;}~
f readPlaintextData (Ljava/nio/ByteBuffer;)I readFromSSL?Y
?? java/lang/Math? min (II)I??
?? readerIndex? ?
f? getBytes?h
f? sslRead dst wrap N([Ljava/nio/ByteBuffer;IILjava/nio/ByteBuffer;)Ljavax/net/ssl/SSLEngineResult; javax/net/ssl/SSLException? "java/lang/IllegalArgumentException? srcs is null? (Ljava/lang/String;)V g?
?? dst is null? #java/lang/IndexOutOfBoundsException? java/lang/StringBuilder? g ?
?? offset: ? append -(Ljava/lang/String;)Ljava/lang/StringBuilder;??
?? (I)Ljava/lang/StringBuilder;??
??
, length: ? 6 (expected: offset <= offset + length <= srcs.length (? ))? toString ()Ljava/lang/String;??
??
??
isReadOnly? ?
?? java/nio/ReadOnlyBufferException?
?? isOutboundDone? ?
? Q ?
? isDestroyed? ?
? java/lang/Object? 8 4 ? 5 4 ? remaining? ?
??
writableBytes? ?
f? bioLengthByteBuffer (J)I??
?? bioFlushByteBuffer??
?? NOT_HANDSHAKING /Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;?? ? newResultMayFinishHandshake R(Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;II)Ljavax/net/ssl/SSLEngineResult;??
? bioClearByteBuffer? ?
?? f = ?
readableBytes? ?
f? java/lang/AssertionError? The destination buffer ? -(Ljava/lang/Object;)Ljava/lang/StringBuilder;??
?? E didn't have enough remaining space to hold the encrypted content in ? (Ljava/lang/Object;)V g?
?? internalNioBuffer (II)Ljava/nio/ByteBuffer;??
f? put ,(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;??
??
doSSLShutdown ?
NEED_WRAP? FINISHED ? STARTED_EXPLICITLY ?
STARTED_IMPLICITLY ?
d e newResult?
handshake 1()Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;
@ = ?
SSL_ST_ACCEPT $ ? setState (JI)V
?! bioLengthNonApplication#?
?$ getHandshakeStatus 2(I)Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;&'
( ` mayFinishHandshake `(Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;)Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;+,
- NEED_UNWRAP/? 0 3 4 2 srcs[4 ] is null6 calculateOutNetBufSize8?
9 BUFFER_OVERFLOW &Ljavax/net/ssl/SSLEngineResult$Status;;< =&
? Z(Ljavax/net/ssl/SSLEngineResult$Status;Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;II)V gA
BGH
D getError (JI)IFG
?H SSL_ERROR_ZERO_RETURNJ $ ?K A = M closeAllO ?
P SSL_ERROR_WANT_READR $ ?S SSL_ERROR_WANT_WRITEU $ ?V SSL_writeX shutdownWithError 0(Ljava/lang/String;)Ljavax/net/ssl/SSLException;Z[
\ i
pendingNow hs sslError bytesWritten bioLengthBefore status srcsLen endOffset
bytesConsumed
bytesProduced bioReadCopyBuf srcs offset length OKm< n x(Ljavax/net/ssl/SSLEngineResult$Status;Ljavax/net/ssl/SSLEngineResult$HandshakeStatus;II)Ljavax/net/ssl/SSLEngineResult;p
q1 ?
s CLOSEDu< v getLastErrorx?
?y B(Ljava/lang/String;Ljava/lang/String;)Ljavax/net/ssl/SSLException;Z{
|
operations err ? -io/netty/util/internal/logging/InternalLogger? isDebugEnabled? ??? {} failed: OpenSSL error: {}? debug 9(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V????
?? #javax/net/ssl/SSLHandshakeException?
?? operation unwrap Q([Ljava/nio/ByteBuffer;II[Ljava/nio/ByteBuffer;II)Ljavax/net/ssl/SSLEngineResult; java/lang/NullPointerException?j
?? dsts is null? 6 (expected: offset <= offset + length <= dsts.length (? dsts[? 7 4 ? 6 4 ? BUFFER_UNDERFLOW?< ??p
? io/netty/handler/ssl/SslUtils? getEncryptedPacketLength ([Ljava/nio/ByteBuffer;I)I??
?? *io/netty/handler/ssl/NotSslRecordException? not an SSL/TLS record?
??
??wx
? hasRemaining? ?
????
? Z ?
? getLastErrorNumber? ?
?? sslReadErrorResult $(III)Ljavax/net/ssl/SSLEngineResult;??
? getShutdown??
?? SSL_RECEIVED_SHUTDOWN? $ ?? bytesRead localBytesConsumed pendingEncryptedBytes bioWriteCopyBuf packetLength
srcsOffset
srcsLength dsts
dstsOffset
dstsLength capacity
dstsEndOffset
srcsEndOffset getErrorString (J)Ljava/lang/String;??
?? SSL_read? errStr
closeOutbound? ?
? closeInbound? ?
? getHandshakeCount??
?? )remote-initiated renegotation not allowed? M([Ljava/nio/ByteBuffer;[Ljava/nio/ByteBuffer;)Ljavax/net/ssl/SSLEngineResult;??
? -(Ljava/nio/ByteBuffer;)[Ljava/nio/ByteBuffer; resetSingleSrcBuffer resetSingleDstBuffer N(Ljava/nio/ByteBuffer;[Ljava/nio/ByteBuffer;II)Ljavax/net/ssl/SSLEngineResult; _?
?? ?
? K(Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Ljavax/net/ssl/SSLEngineResult; L([Ljava/nio/ByteBuffer;Ljava/nio/ByteBuffer;)Ljavax/net/ssl/SSLEngineResult;??
? a?
???
?? ?
? L(Ljava/nio/ByteBuffer;[Ljava/nio/ByteBuffer;)Ljavax/net/ssl/SSLEngineResult; getDelegatedTask ()Ljava/lang/Runnable; PInbound closed before receiving peer's close_notify: possible truncation attack? SSL_SENT_SHUTDOWN $ ? mode isInInit?
? shutdownSSL?
? SSL_ERROR_SYSCALL $ ?
SSL_ERROR_SSL $ ? &SSL_shutdown failed: OpenSSL error: {} '(Ljava/lang/String;Ljava/lang/Object;)V?? sslErr getSupportedCipherSuites ()[Ljava/lang/String; AVAILABLE_CIPHER_SUITES Ljava/util/Set; ?
java/util/Set size" ?!# toArray (([Ljava/lang/Object;)[Ljava/lang/Object;%&!' ? getEnabledCipherSuites
getCiphers (J)[Ljava/lang/String;+,
?- "io/netty/util/internal/EmptyArrays/
EMPTY_STRINGS1 ? 02 toJavaCipherSuite &(Ljava/lang/String;)Ljava/lang/String;45
6 enabled mapped setEnabledCipherSuites java/lang/Exception; cipherSuites= )io/netty/handler/ssl/CipherSuiteConverter? toOpenSslA5
@B isCipherSuiteAvailable (Ljava/lang/String;)ZDE
?F unsupported cipher suite: H (C)Ljava/lang/StringBuilder;?J
?Kl ?
?M empty cipher suitesO setLength (I)VQR
?S setCipherSuites (JLjava/lang/String;)ZUV
?W java/lang/IllegalStateExceptionY failed to enable cipher suites: [ *(Ljava/lang/String;Ljava/lang/Throwable;)V g]
Z^
Z? converted c e Ljava/lang/Exception; Ljava/lang/StringBuilder; cipherSuiteSpec getSupportedProtocols SUPPORTED_PROTOCOLS_SETh ?i getEnabledProtocols java/util/ArrayListl gR
mn
SSLv2Hellop java/util/Listr add (Ljava/lang/Object;)Ztusv
getOptionsx?
?ys' SSL_OP_NO_TLSv1| $ ?} TLSv1 isProtocolEnabled (IILjava/lang/String;)Z??
? SSL_OP_NO_TLSv1_1? $ ?? TLSv1.1? SSL_OP_NO_TLSv1_2? $ ?? TLSv1.2? SSL_OP_NO_SSLv2? $ ?? SSLv2? SSL_OP_NO_SSLv3? $ ?? SSLv3?s# opts contains?u!? disableMask protocolString
?? Protocol ? is not supported.? equals?u
?? clearOptions?
??
setOptions?
?? failed to enable protocols: ? java/util/Arrays? asList %([Ljava/lang/Object;)Ljava/util/List;??
?? p sslv2 sslv3 tlsv1 tlsv1_1 tlsv1_2
getSession beginHandshake ? checkEngineClosed (Ljavax/net/ssl/SSLException;)V??
? ? renegotiate??
?? doHandshake??
?? java/lang/System? currentTimeMillis?0
?? renegotiation failed? java/lang/Error?
??
pendingStatus isEmpty ([Ljava/lang/Object;)Z arr [Ljava/lang/Object; ([B)Z cert [B ?t s;? <