Couldn't find existing issue so I decide to create new one. I just quote beginning of issue found on ubercart.org site.

Can't get to review page

I'm testing our ubercart module and I can't seem to get to the review page. Every time I hit the check out button and the button of the page I get this error "To protect our customers from identity theft, credit card details are erased when a browser refreshes on the checkout review page. Please enter your card details again and re-submit the form." (...)

The problem basically occur when you accidentally leave new line (or whatever whitespace / tab/ newline/ etc.) on the end (or in the beginning) in your uc_credit.key secret file. It's really hard to spot and system doesn't give any useful information except misleading above message: "To protect our customers from ...".

So my solution is simple just trim() every whitespace from the beginning and end of the key, after loading.

Patch in attachment.

Files: 
CommentFileSizeAuthor
#10 1730626-credit-key-whitespace-D6.patch1.04 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 1,917 pass(es).
[ View ]
#8 1730626-credit-key-whitespace.patch1.04 KBlongwave
PASSED: [[SimpleTest]]: [MySQL] 2,453 pass(es).
[ View ]
ubercart-cant_get_review_page-trim-uc_credit-key.patch429 bytessobi3ch
PASSED: [[SimpleTest]]: [MySQL] 1,908 pass(es).
[ View ]

Comments

Status:Active» Needs review

Forget to set proper status..

OK, we can do that. But how did you get whitespace in your key file? The contents are generated automatically by Ubercart, so unless you edited the file and added the whitespace this should never happen. If Ubercart is generating key files with whitespace, then we ought to do more than just trim() here, we ought to fix the key file generation code.

Priority:Normal» Minor
Status:Needs review» Postponed (maintainer needs more info)

Status:Postponed (maintainer needs more info)» Active

Hi, ok my flout. I've just copy&paste my previous uc_creadit.key, and my editor is adding for default "\n" new line character. Now I see in the code I need to provide only directory path for credit key and ubercart doing rest for me. But still it will be nice if ubercart could handle this problem automatically.

What's your thoughts?

Rather than using trim() we should probably throw an error if the uc_credit.key file is not exactly 32 bytes long.

Title:Can't get to review pageCan't get to review page if uc_credit.key contains whitespace

agree, I'll role path asap..

Version:6.x-2.x-dev» 7.x-3.x-dev
Status:Active» Needs review
StatusFileSize
new1.04 KB
PASSED: [[SimpleTest]]: [MySQL] 2,453 pass(es).
[ View ]

Patch for 7.x that simplifies uc_credit_encryption_key() while adding this check.

Version:7.x-3.x-dev» 6.x-2.x-dev
Status:Needs review» Patch (to be ported)

Committed to 7.x-3.x, needs porting to 6.x-2.x.

Status:Patch (to be ported)» Needs review
StatusFileSize
new1.04 KB
PASSED: [[SimpleTest]]: [MySQL] 1,917 pass(es).
[ View ]

Status:Needs review» Fixed

Committed to 6.x-2.x.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.