@jimp So had a look into this a bit and I believe this is probably NPS expecting passwords to be ucs2 rather than the utf8 that gets sent.
Think its this project https://github.com/pear/Crypt_CHAP that the authentication test uses behind the scenes that has a bug in str2unicode. similar issue here https://github.com/dapphp/radius/issues/5
Changed the str2unicode function on the pfsense 2.7 dev version I was using for testing and now a user with the password: Password!"£$%^&* works as expected when it didn't before.
function str2unicode($str)
{
$uni = '';
$str = (string) $str;
for ($i = 0; $i < mb_strlen($str); $i++) {
$a = mb_ord(mb_substr($str,$i,1)) << 8;
if ( $a > 65536){
echo "NPS does not support non BMP codepoints\n";
return;
}
$uni .= sprintf("%X", $a);
}
return pack('H*', $uni);
}
I'm no unicode expert or PHP but as UCS2 is only 16 bit it can't support any code points over 65536 so added a check to fail if it finds this. So no emojis or no 4 byte Chinese codepoints.
This might still work fine in strongswan as read they added a fix for this so might just have been the authentication tab that was not working correctly. Will register for the bugtracker in the morning and update that bug.