-
Notifications
You must be signed in to change notification settings - Fork 179
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
Authorizekey allows too few characters #304
Comments
Hi @baldur4464, Thanks for reaching out. I would argue that all limits are defined by the official specification, but I would have to look it up. Does anyone know if the limit is defined by the OCA specification? A quick fix is to fork the project and remove the limit. |
This is the description for AuthorizationKey.
|
Unfortunately, this is all wrong! The OCPP 1.6 AuthorizationKey is only represented as 32-40 hexadecimal characters when configured using the ChangeConfigurationRequest (because that only allows strings to be sent as values). But when the AuthorizationKey is to be used for HTTP Basic Authentication, it MUST BE DECODED and sent as a byte array of 16 to 20 BYTES. The limit of 20 was totally correct. |
In this PR it was also changed from bytearray to a String. That is why the length had to be adjusted. In the original code it was not functional, as the decoding was wrong. There was a mixup between the string representation and the bytearray. |
The password IS a byte array of 16 to 20 bytes, as per the OCPP 1.6 specification. Where do you see a mixup with the string representation? The only string representation is the BASE64 encoding, and that is correctly decoded to a byte array. |
Hello, the problem I experienced (and only worked with that fix) was when I try to connect to a custom server (using the present library) using a password. I'm using https://github.com/matth-x/MicroOcppSimulator for testing. Unless that simulator is not conforming. The only physical charger I have is an EVlink, but it does not support a password at all to test. |
From what I see, MicroOcppSimulator does not support HTTP Basic Authentication at all, and even gets the security profile wrong (HTTP Basic Authentication is Security Profile 1). From src/net_wasm.c:
So that is definitely not a reference for compliant OCPP 1.6 HTTP Basic Authentication handling. |
Hello, I am currently working on a project that automatically checks incoming messages for plausibility. During development, I came across a problem.
My project emulates a Central System (CS) and I first tested it with a Chargepoint (CP) simulation (Open-OCPP). The CP was always able to connect to the CS.
When we then tried to test my project on a real charge point, no connection was established. This always resulted in a 404 Websocket Upgrade Failure. Since we had no further debug information, I used Wireshark to check the incoming and outgoing messages.
I noticed that the CP's AuthorizeKey contains more than 20 characters. I then checked in your code how this key is checked and there I noticed that the length must be between 16 - 20 characters long and if this condition is not met, the websocket cannot be established.
Now the question arises, is there a reason why the characters are limited to 20 characters? Otherwise, I would like to suggest increasing the number of characters, as I do not see a security problem in this case.
The text was updated successfully, but these errors were encountered: