286 SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, |
286 SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, |
287 int headerOffset, int dstLim, int headerSize, |
287 int headerOffset, int dstLim, int headerSize, |
288 ProtocolVersion protocolVersion) { |
288 ProtocolVersion protocolVersion) { |
289 if (!encCipher.isNullCipher()) { |
289 if (!encCipher.isNullCipher()) { |
290 // inner plaintext, using zero length padding. |
290 // inner plaintext, using zero length padding. |
291 int pos = destination.position(); |
291 int endOfPt = destination.limit(); |
292 destination.position(destination.limit()); |
292 destination.limit(endOfPt + 1); |
293 destination.limit(destination.limit() + 1); |
293 destination.put(endOfPt, contentType); |
294 destination.put(contentType); |
|
295 destination.position(pos); |
|
296 } |
294 } |
297 |
295 |
298 // use the right TLSCiphertext.opaque_type and legacy_record_version |
296 // use the right TLSCiphertext.opaque_type and legacy_record_version |
299 ProtocolVersion pv = protocolVersion; |
297 ProtocolVersion pv = protocolVersion; |
300 if (!encCipher.isNullCipher()) { |
298 if (!encCipher.isNullCipher()) { |