Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPCS cleanup and PHP cs fixer config #200

Merged
merged 1 commit into from Apr 5, 2016

Conversation

larowlan
Copy link
Contributor

@larowlan larowlan commented Apr 4, 2016

Fixes #198
Branched from #197

Changes as follows:

  • Uses https://github.com/FriendsOfPHP/PHP-CS-Fixer to automate as much as possible, including adding a config file. For future cleanups, just run php-cs-fixer fix from project root after installing globally.
  • Adds missing doc-blocks, fixes some class not found issues and various other issues reported by php-storm inspections

@defuse
Copy link
Owner

defuse commented Apr 4, 2016

Thanks!

-1 to including the license text in the files. It's distracting and apparently for legal reasons it's super difficult to ever remove it in the future.

@defuse
Copy link
Owner

defuse commented Apr 4, 2016

Can we get the same changes but without the license in the files? :)

@larowlan
Copy link
Contributor Author

larowlan commented Apr 4, 2016

Sure, will update .php_cs to remove it too
On 5 Apr 2016 7:58 am, "Taylor Hornby" notifications@github.com wrote:

Can we get the same changes but without the license in the files? :)


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#200 (comment)

@larowlan
Copy link
Contributor Author

larowlan commented Apr 5, 2016

Ok, removed licenses and updated php cs fixer config

Core::KEY_BYTE_SIZE,
Core::ENCRYPTION_INFO_STRING,
$file_salt
);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh god, the diff is going all screwy here. I think it's just whitespace changes but Github isn't highlighting them, so I can't tell if it's just whitespace or if this commit inserts hidden backdoors!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does https://github.com/defuse/php-encryption/pull/200/files?w=1 help - the ?w=1 should ignore whitespace changes

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@larowlan: Oh yes, it very much does help, thanks!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it still screws up displaying the decryptResource stuff :( Oh well

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it hates extra spaces.

@defuse
Copy link
Owner

defuse commented Apr 5, 2016

LGTM. I was careful to review it for subtly-inserted backdoors and I couldn't find any. Just to be super cautious I'm going to redo the File.php changes myself as I'm merging, since GitHub's diff is glitching and I can't easily see that it's only whitespace changes.

(Underhanded Crypto contest entry idea: Find a bug in GitHub's diff algorithm to make it look like whitespace changes when it's not).


$thisIv = $iv;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's scary how easy a backdoor could be hidden in all of this!

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to others reading: This isn't actually a backdoor, the line isn't actually removed, the diff is just glitching.

@defuse defuse merged commit 8be5f7f into defuse:make-file-crypto-compatible Apr 5, 2016
@defuse
Copy link
Owner

defuse commented Apr 5, 2016

I just merged @larowlan's PR without applying the changes to File.php myself as I said I would. It was too much work to do it manually. Instead, I looked over the (buggy) diff for a couple minutes and tried to make sure the code was the same. I think it is, but I can't be certain. Hopefully @larowlan didn't just insert a backdoor into our library!

@larowlan: Thanks so much for this! The code looks a lot better now :)

@paragonie-scott
Copy link
Collaborator

I looked over it last night. Per #110 we're going to audit this again before v2.0.0 is tagged, so we'll find out either way.

@larowlan
Copy link
Contributor Author

larowlan commented Apr 5, 2016

Neat, thanks
On 6 Apr 2016 8:42 am, "Scott" notifications@github.com wrote:

I looked over it last night. Per #110
#110 we're going to
audit this again before v2.0.0 is tagged, so we'll find out either way.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#200 (comment)

@narfbg
Copy link
Contributor

narfbg commented Apr 7, 2016

Structural, functional and styling changes don't belong together in the same patch - that's why it's so hard to review this.

@defuse
Copy link
Owner

defuse commented Apr 7, 2016

@narfbg: Yeah, I understand. You can still review commit-by-commit.

@defuse
Copy link
Owner

defuse commented Apr 7, 2016

@narfbg: Oh whoops, I thought we were on #212 nevermind!

@narfbg
Copy link
Contributor

narfbg commented Apr 7, 2016

Well, even if that was the case, I'd still argue in favor of a policy to limit the scope of separate PRs. That's what I was trying to imply here. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants