private static byte[] readSecurityBuffer(final byte[] src, final int index) throws NtlmEngineException { final int length = readUShort(src, index); final int offset = readULong(src, index + 4); if (src.length < offset + length) { throw new NtlmEngineException("NTLM authentication - buffer too small for data item"); } final byte[] buffer = new byte[length]; System.arraycopy(src, offset, buffer, 0, length); return buffer; }
private static byte[] readSecurityBuffer(final byte[] src, final int index) throws NtlmEngineException { final int length = readUShort(src, index); final int offset = readULong(src, index + 4); if (src.length < offset + length) { throw new NtlmEngineException("NTLM authentication - buffer too small for data item"); } final byte[] buffer = new byte[length]; System.arraycopy(src, offset, buffer, 0, length); return buffer; }