Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2011 at 09:44 UTC
Updated:
28 Feb 2012 at 01:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
doitDave commentedHi,
brief manual review:
Comment #2
IcanDivideBy0 commentedHi,
Thank you for reply :
commerce_paybox_paybox_serversvariable is used in settings form as textarea (see includes/commerce_paybox.admin.inc).Comment #3
IcanDivideBy0 commentedNon-hook functions comments has been updated according to http://drupal.org/node/1354#functions
"Payment method callback" comments are done the same way they can be seen in commerce_payment_example and commerce_paypal modules.
Comment #4
doitDave commentedHi,
ok, just take the hint on serialization as a general one. Of course you may store into the variables whatever you suppose is best ;)
Let's see what the old stagers will still find ;)
Good luck!
Comment #5
doitDave commentedOh, wait... you are still on the master branch, but you should move to a major release branch; see http://drupal.org/node/1127732 for details. Sorry I missed that in the first round.
Comment #6
IcanDivideBy0 commentedCreated 7.x-1.x branch, I'll edit issue summary.
Thank you again
Comment #7
doitDave commentedHi,
Automated review (Please keep in mind that this is primarily a high level check that does not replace but, after all, eases the review process. There is no guarantee that no other issues could show up in a more in-depth manual follow-up review.)
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.
Remark: The "operator" issue in 335 is a false positive.
HTH, dave
Comment #8
IcanDivideBy0 commented@doitDave done.
Please, can someone have a REAL review of this module, I'm ok to well format my code, but this is really turning ridiculous... put the status to "need work" just for ONE comment on the wrong line is making us loosing so much time.
annoying to have to push on the repository only to reformat one line... not a bug
read the module !!! this is in the API file to describe hooks defined by the module...
ok... false positive
ending new line is missing in the README.txt... huge error, my bad
I see no reason to freeze the review process here, so please, I just ask for someone to have a REAL look at the module, not just checking if any line is longer than 80 characters (even drupal core don't pass the lazy "coder" module review).
Thank you
Comment #9
doitDave commentedHi.
as I am obviously being adressed with your recent comment, you may probably want to consider a few things.
I can understand your impatience. Honestly. And I would be as happy as many others if there were dozens of people here making this approval a question of a few hours. (As I am, besides, still waiting myself.)
Of course this decision is up to anyone himself, but *I* decided to help myself speeding up this thin instead of complaining. Sorry, but I felt that had to be said. Just think about it.
Thank you!
Comment #10
elc commentedFollowing and fixing up any Coding Standards issues means that manual review is made much easier and we don't get stuck on them.
The raw usage of $_GET is all fine.
Comment #11
simon.meeschaert commentedHi,
How can I download this module ? I think the link is broken...
Thanks
Comment #12
patrickd commentedAs this is still a sandbox project, it has no downloadable releases yet.
You have to clone it with git or browse the repository and download the current snapshot.
Generally I would not suggest you to use a sandbox module if you don't know what your doing ;)
Comment #13
artusamakI mostly agree with #10, i'll add few points:
* in commerce_paybox_auto(), when you check the return value of commerce_paybox_check_sign() you should insert an entry in the watchdog if the return code is a failure.
You should throw an exception instead of echoing an empty string to stop the execution of the page if nothing happened.
* in commerce_paybox_ppps_submit_form() why do you fetch the default settings and don't do anything with it?
Comment #14
IcanDivideBy0 commented#10
@ELC Tanks for the review.
Adding entity module dependency (even if commerce module depends on it too).
Updated project's page requirements.
BTW this shall be more efficient cause implode/explode is now called only while editing settings.
commerce_paybox_settings_formis not a hook_form, but a Payment method callback. There is no way to add a validation step to this form (even through$form['#validate'][] = ...). If someone knows any way to do it, please tell me, I would like to have some validation here.Using drupal_http_request is a greate idea, i'll surelly develop it in a later version...
#14
* Added a watchdog entry if the return code is a failure. Simply added an exit after echoing an empty string.
* Removed unused settings in commerce_paybox_ppps_submit_form()
Comment #15
duaelfrThis module looks good ! I hope it will be stable enough to test it on a real project in a few weeks.
Thank you for your work.
Comment #16
IcanDivideBy0 commentedActually, it will be used on a real site in a couple few weeks. I'm not sure it's a good idea to say which site will use commerce_paybox, but i'll assume maintenance for the site, so any fix will be committed very fast in the project's sandbox.
I believe making a demo site for such a simple module is pointless. no ?
Comment #17
artusamakNo need for a demo site there, that would imply having a Paybox demo account and it usually don't happen.
Comment #18
saturnino commentedHi
What's new with your module?
Where can I download the current version.
best regards
Comment #19
elc commentedLooks like you've got a few cases where the strict coding standards will trigger; mostly using spaces to make things look pretty. Run the module through the coder module on strict to deal with any of those. I believe there's a website which will do this for you if you ask it nicely.
he rest of the changes you've made look really good.
Comment #20
IcanDivideBy0 commentedThanks again for the review.
NULL.#element_validateon settings form. Also move functions related to offsite payment incommerce_paybox_offsite_*. So the common settings form is built in thecommerce_paybox_common_settings_form.Comment #21
elc commentednon-blockers
I'm afraid I don't have time to track down the developer docs for Paybox, I'm just looking at the code and thinking it's a strange way to handle the request URI if they were already automatically processed GET vars. If you could provide an example I could judge easily whether there might be a better way to deal with it. For now though, it can be as it looks secure.
Regarding the default key fallback, you can simplify that code by using
variable_get('commerce_paybox_pubkey_path', drupal_get_path('module', 'commerce_paybox') . '/pubkey.pem');initially, negating the need for a double wrapped version. variable will return the 2nd parameter, the default value, if the variable is missing. The check on the settings input form has ensured that the file in the variable was in existence when it was set.You also seem to call file_get_contents($key_file) a lot in that function. Once should be enough.
Would something like this work?
Anyway, the rest of this module looks like it's all well and good.
Comment #22
IcanDivideBy0 commentedHere is an example of a valid URI that Paybox may call :
q=commerce_paybox/auto&txnid=61&error=00004&sig=bfq0uj3553qkYln/6p/NShOpE9LGmrmPQWlWKziDR3k/aULYviqiF6Ez/FugTuH2E1TYpiuVFtf455GlRWIhyaPC6XdGc5KAtBzC8SehWOiZ3Cwf6PPEIhDsDsWvRVajjsx9wTp5XL2C7%2BLoKtftHUikOZic6jr62cnr1wAieOk%3DBut, any module can modify the query elements (keys and/or values) by implementing
hook_commerce_paybox_paramsand altering$pbx_params['PBX_RETOUR'](default is set @line 218). So we can't be sure of what is present in$_GET.Comment #23
elc commented/me puts on his suggestion hat.
There's actually a PHP function that will do all that parsing for you which will handle any strange things like parameters moving around or anything else that might upset the positional parsing.
http://www.php.net/manual/en/function.parse-str.php
gives the following from what you have posted
You can then use $arg['sig'], but it looks like the data "txnid=61&error=00004" needs to be reconstituted and http_build_query is really good at that.
My testing code ended up being the following. If someone is sending your validation function strange things, what happens when the positional stuff doesn't match up to what is passed? ie, they're screwing with it. The function is getting passed a global variable anyway, it could source it itself.
Anyway, that's just a suggestion. This module is still RTBC and we should probably create an issue in the module issue queue for something like this.
Comment #24
IcanDivideBy0 commentedI agree that your code is a way more readable, but ther's a mistake :
In fact, we can't know which datas are sent in $_GET cause any module can alter it with
hook_commerce_paybox_params.txnidanderrorare required, but you can add many datas (like country of the card holder, ...)Comment #25
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Get a review bonus and we will come back to your application sooner.
manual review:
But that are just minor issues, so ...
Thanks for your contribution, IcanDivideBy0! Welcome to the community of project contributors on drupal.org.
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #26
elc commentedOk, that's a not a very good interface from Paybox then. If the parameters can be anything, it should include a parameter on the end specifying which parameters it signed, and in what order. That method is fairly common - eg DKIM.
In the mean time, this would work.
If they really are going to simply throw a signature on the end of whatever they call back to your site with, then a preg_match would also work.
Anyway, you're on your way.
Comment #27
IcanDivideBy0 commentedThanks klausi, ELC,
Fixed the minor issues klausi mensioned.
Now, I'm using ELC code, just modified a bit the regular expression to work with clean url enabled :
Tests still passes.
Thanks for the time you spend on this review.
Comment #28
elc commentedLooks like your project is stuck without a release tag.
Types of releases for full projects
Release naming conventions
Creating a project release
Creating a branch or tag in Git
Comment #29.0
(not verified) commentedChanged git branch from master to 7.x-1.x