ssize_t len;
uint8_t ucs2_password[512];
+ if (!password || !*password) {
+ fr_strerror_printf("Password is missing or is empty");
+ return -1;
+ }
+
len = fr_utf8_to_ucs2(ucs2_password, sizeof(ucs2_password), password, strlen(password));
if (len < 0) {
+ fr_strerror_printf("Password contains invalid UTF-8 characters, and cannot be converted to UCS2");
*out = '\0';
return -1;
}
nt_password->vp_octets = p = talloc_array(nt_password, uint8_t, nt_password->vp_length);
if (mschap_ntpwdhash(p, password->vp_strvalue) < 0) {
- RERROR("Failed generating NT-Password");
+ RERROR("Failed generating NT-Password - %s", fr_strerror());
return RLM_MODULE_FAIL;
}
} else if (auth_method == AUTH_INTERNAL) {