/* nt_password_hash - NtPasswordHash() - RFC 2759, Sect. 8.3 @password: 0-to-256-unicode-char Password (IN; UTF-8) @password_len: Length of password @password_hash: 16-octet PasswordHash (OUT) Returns: 0 on success, -1 on failure  */
int nt_password_hash(const u8 *password, size_t password_len, u8 *password_hash)
/* nt_password_hash - NtPasswordHash() - RFC 2759, Sect. 8.3 @password: 0-to-256-unicode-char Password (IN; UTF-8) @password_len: Length of password @password_hash: 16-octet PasswordHash (OUT) Returns: 0 on success, -1 on failure  */
int nt_password_hash(const u8 *password, size_t password_len, u8 *password_hash)
{
	u8 buf[512], *pos;
	size_t len, max_len;
	max_len = sizeof(buf);
	if (utf8_to_ucs2(password, password_len, buf, max_len, &len) < 0)
		return -1;
	len *= 2;
	pos = buf;
	return md4_vector(1, (const u8 **) &pos, &len, password_hash);
}