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

AES: Length incorrect. Error #150

Open
MZK91 opened this issue May 5, 2022 · 11 comments
Open

AES: Length incorrect. Error #150

MZK91 opened this issue May 5, 2022 · 11 comments
Labels
bug Something isn't working

Comments

@MZK91
Copy link

MZK91 commented May 5, 2022

Hi guys,

I'm coming back with another issue I'm facing using the class, but this time I think it might come from the bank. I needed some information regarding this error message.

So the problem appears when I try to use the action "FDL", I got a response from the bank, but it generates this error:

image

Do you guys have any ideas about where it might come from ?

Thanks in advance for any info.

@andrew-svirin
Copy link
Member

Hi
@MZK91 what version do you use?

@andrew-svirin
Copy link
Member

Modify this row
throw new LogicException('Length incorrect.');
to
throw new LogicException(sprintf('Length %d incorrect (block_size is %d).', $length, $this->block_size));

@MZK91
Copy link
Author

MZK91 commented May 5, 2022

I'm using the last version and thank for the change, here the result that I have:

image

@andrew-svirin
Copy link
Member

Try to change this line https://github.com/andrew-svirin/ebics-client-php/blob/2.x/src/Models/Crypt/AES.php#L401

to return ''; instead of throw new Exception

@MZK91
Copy link
Author

MZK91 commented May 5, 2022

I did the change you ask me to and this is the result:
image

@andrew-svirin
Copy link
Member

@MZK91
Copy link
Author

MZK91 commented May 5, 2022

Here the result that I have:

image

@andrew-svirin
Copy link
Member

When have not idea. Some problem with decryption. But this method worked last time for me.

@andrew-svirin andrew-svirin added the bug Something isn't working label May 5, 2022
@MZK91
Copy link
Author

MZK91 commented May 6, 2022

No it was working perfectly and the code was on production on the server. I'm blaming the bank for that one and just wanted to confirm with you. I think they might have change something on their side that cause the issue.

Thank you so much Andrew for you help, you the best bro !

@andrew-svirin
Copy link
Member

@MZK91 I am not sure that bank system working wrong, but do not exclude it.
For example can be some zero-byte that what escaped. I mean that some text that should be decoded should have leading zero-bytes to have in result full cartage. For example, bank can send instead of 00012CF - 12CF value and algorithm should know that 12CF -should be converted to 8 bytes 00012CF and for encoding/decoding this can be critical.

@andrew-svirin
Copy link
Member

If someone will met same bug we can conclude that some incorrect in decoding algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants