fix: consider already integer value#2107
fix: consider already integer value#2107vitormattos wants to merge 1 commit intophpseclib:masterfrom
Conversation
Signed-off-by: Vitor Mattos <[email protected]>
|
Looking at RSASSA_PSS_params.php it looks like this is chiefly an issue if saltLength isn't explicitly defined. A unit test for this would be good. I should be able to generate a key that reproduces the problem but to save time could you provide the key you're using? This is probably an issue in the 3.0 branch as well. I want to say that the 2.0 branch doesn't support PSS keys but I could be wrong. But, also, a unit test would enable us to see if it's even still an issue after #2105 is merged. Thanks! |
|
I ran some tests on my side and found that the issue was not related to phpseclib itself. I was using the Scoper package, and it applied changes beyond just namespace rewriting. When I tested the same scenario with the same certificate without Scoper, everything worked correctly. |
|
I was able to create a key that manifests the problem in phpseclib v3: It's not an issue in the master branch of phpseclib, presumably because every time you try to access an element, if an encoding doesn't exist, it'll encode / decode it so that an encoding does exist. |
|
I cherry-picked this commit to the 3.0 branch and added a unit test. It's not an issue in the 1.0 / 2.0 branch because those branches don't decode the parameters of PSS keys. |
Signed-off-by: Vitor Mattos <[email protected]>
At my environment, when the saltLength already is an integer value, throw an error because integer isn't object.