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

Use correct Secure Cell API in PHPThemis #601

Merged
merged 2 commits into from
Mar 5, 2020

Conversation

ilammy
Copy link
Collaborator

@ilammy ilammy commented Mar 2, 2020

Hey, #594, it's not enough to name the function with_passphrase and accept passphrase arguments. You also need to call Themis Core API that uses passphrases.

PHP 5 calls the correct API but PHP 7 fell prey to a copy-paste mistake.

Moral of the story: copy-paste is bad 🤦‍♂

(Caught by integration tests with Python in #596, they’re good. I wonder if we need PHP 5 ⟺ PHP 7 integration tests now. Since our current tests use whatever PHP is installed in the system.)

Checklist

  • Change is covered by automated tests
  • The coding guidelines are followed
  • Changelog is updated

It's not enough to name the function "with_passphrase" and accept
"passphrase" arguments. You also need to call Themis Core API that
uses passphrases.

PHP 5 calls the correct API but PHP 7 fell prey to a copy-paste mistake.
@ilammy ilammy added the W-PHPThemis 🐘 Wrapper: PHPThemis, PHP API label Mar 2, 2020
@ilammy
Copy link
Collaborator Author

ilammy commented Mar 2, 2020

This is also the reason why I don’t like to have two APIs which accept identical arguments, do similar but different things with only tiny difference in naming.

@Lagovas
Copy link
Collaborator

Lagovas commented Mar 2, 2020

next time better to start to implement new features in php7 and then copy-paste them to php5, because second is a candidate to drop )

Copy link
Collaborator

@Lagovas Lagovas left a comment

Choose a reason for hiding this comment

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

lgtm

Make sure this isssue does not happen again. Say, when we port PHPThemis
to PHP 7.4 using FFI module.
@ilammy ilammy merged commit ba87f06 into cossacklabs:master Mar 5, 2020
@ilammy ilammy deleted the php-kdf-api branch March 5, 2020 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
W-PHPThemis 🐘 Wrapper: PHPThemis, PHP API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants