Source:
<code>private byte[] unwrapConfidentialityProtectedMessage(byte[] message, int offset, int len) throws SaslException { int messageType = DigestUtils.decodeByteOrderedInteger(message, offset + len - 6, 2); <START> int extractedSeqNum = DigestUtils.decodeByteOrderedInteger(message, offset + len - 4, 4); <END> if (messageType != 1) { throw new SaslException("MessageType must equal to 1, but is different"); } if (extractedSeqNum != unwrapSeqNum) { throw new SaslException("Bad sequence number while unwrapping"); } byte[] clearText = null; try { clearText = unwrapCipher.update(message, offset, len - 6); } catch (Exception e) { throw new SaslException("Problem during decrypt.", e); } byte[] hmac = new byte[10]; System.arraycopy(clearText, clearText.length - 10, hmac, 0, 10); byte[] decryptedMessage = null; if (unwrapCipher.getBlockSize() > 0) { int padSize = clearText[clearText.length - 10 - 1]; int decryptedMessageSize = clearText.length - 10; if (padSize < 8) { int i = clearText.length - 10 - 1; while (clearText[i] == padSize) { i--; } decryptedMessageSize = i + 1; } decryptedMessage = new byte[decryptedMessageSize]; System.arraycopy(clearText, 0, decryptedMessage, 0, decryptedMessageSize); } else { decryptedMessage = new byte[clearText.length - 10]; System.arraycopy(clearText, 0, decryptedMessage, 0, clearText.length - 10); } byte[] expectedHmac = DigestUtils.computeHMAC(unwrapHmacKeyIntegrity, extractedSeqNum, hmacMD5, decryptedMessage, 0, decryptedMessage.length); if (Arrays2.equals(expectedHmac, 0, hmac, 0, 10) == false) { return NO_BYTES; } unwrapSeqNum++; return decryptedMessage; }</code><technical_language>a big deal static imports for method calls DigestUtils need referenced in places</technical_language>

Target:
private byte[] unwrapConfidentialityProtectedMessage(byte[] message, int offset, int len) throws SaslException { int messageType = decodeByteOrderedInteger(message, offset + len - 6, 2); int extractedSeqNum = decodeByteOrderedInteger(message, offset + len - 4, 4); if (messageType != 1) { throw new SaslException("MessageType must equal to 1, but is different"); } if (extractedSeqNum != unwrapSeqNum) { throw new SaslException("Bad sequence number while unwrapping"); } byte[] clearText = null; try { clearText = unwrapCipher.update(message, offset, len - 6); } catch (Exception e) { throw new SaslException("Problem during decrypt.", e); } byte[] hmac = new byte[10]; System.arraycopy(clearText, clearText.length - 10, hmac, 0, 10); byte[] decryptedMessage = null; if (unwrapCipher.getBlockSize() > 0) { int padSize = clearText[clearText.length - 10 - 1]; int decryptedMessageSize = clearText.length - 10; if (padSize < 8) { int i = clearText.length - 10 - 1; while (clearText[i] == padSize) { i--; } decryptedMessageSize = i + 1; } decryptedMessage = new byte[decryptedMessageSize]; System.arraycopy(clearText, 0, decryptedMessage, 0, decryptedMessageSize); } else { decryptedMessage = new byte[clearText.length - 10]; System.arraycopy(clearText, 0, decryptedMessage, 0, clearText.length - 10); } byte[] expectedHmac = computeHMAC(unwrapHmacKeyIntegrity, extractedSeqNum, hmacMD5, decryptedMessage, 0, decryptedMessage.length); if (Arrays2.equals(expectedHmac, 0, hmac, 0, 10) == false) { return NO_BYTES; } unwrapSeqNum++; return decryptedMessage; }