MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / unwrap

Method unwrap

src/SecureRpcHelper.java:200–217  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 2

handleResponseMethod · 0.45
handleResponseMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected