ChangePassword method fail?
RustieNewton opened this issue · 3 comments
The change password method breaks the process, even with a try catch block,
but creating random password and unlocking are fine.
$a = KeyProtectedByPassword::loadFromAsciiSafeString($userdata['protectedKey']); //ok
$a->changePassword( $password, $_REQUEST['newPassword'] );
echo $a->saveToAsciiSafeString(); //fail
However unlocking is fine ...
$a = KeyProtectedByPassword::loadFromAsciiSafeString($userdata['protectedKey']); //ok
$a->unlockKey($_REQUEST['oldPassword']); //ok
echo $a->saveToAsciiSafeString(); //ok
//a simpler way of putting this apparent bug
$passwordA = "xxx";
$passwordB = "yyy";
$protectedKey = KeyProtectedByPassword::createRandomPasswordProtectedKey($passwordA); //ok
$new = $protectedKey->changePassword($passwordA, $passwordB ); //breaks
Sorry for the super slow response. Your example code runs without error for me. If you are still facing this issue, is there any error output or logs from PHP from the call that breaks?
I'm going to close this but feel free to re-open it if you're still encountering a bug.