When QOP of auth-int or auth-conf is selected This is used to unwrap the contents from the passed buffer payload. It should be called as soon as it comes off the Netty channel. Note that the ReplayingBufferDecoder may throw an error if we are unable to read the full buffer and replay the data. @para
(final ChannelBuffer payload)
| 198 | * the payload |
| 199 | */ |
| 200 | public ChannelBuffer unwrap(final ChannelBuffer payload) { |
| 201 | if (!use_wrap) { |
| 202 | return payload; |
| 203 | } |
| 204 | |
| 205 | final int len = payload.readInt(); |
| 206 | try { |
| 207 | final ChannelBuffer unwrapped = ChannelBuffers.wrappedBuffer( |
| 208 | sasl_client.unwrap(payload.readBytes(len).array(), 0, len)); |
| 209 | // If encryption was enabled, it's a good bet that you shouldn't log it |
| 210 | //if (LOG.isDebugEnabled()) { |
| 211 | // LOG.debug("Unwrapped payload: " + Bytes.pretty(unwrapped)); |
| 212 | //} |
| 213 | return unwrapped; |
| 214 | } catch (SaslException e) { |
| 215 | throw new IllegalStateException("Failed to unwrap payload", e); |
| 216 | } |
| 217 | } |
| 218 | |
| 219 | /** |
| 220 | * When QOP of auth-int or auth-conf is selected |
no outgoing calls
no test coverage detected