Menu

#22 Invalid test data used in main_example.c?

1.0
closed
nobody
None
2024-02-14
2024-01-04
Gravis
No

code src/test/main_example.c, function sessionSetup1, line 1507

exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[0] = 0;
exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.characters[1] = 20;
exiOut->V2G_Message.Body.SessionSetupRes.EVSEID.charactersLen = 2;

The specification for EVSEID is of type evseIDType, a restricted string which has a minimum length of 7. Also, if it's a string then why make the initial character null?

Reference: V2G_CI_MsgDataTypes.xsd

        <xs:simpleType name="evseIDType">
                <xs:restriction base="xs:string">
                        <xs:minLength value="7"/>
                        <xs:maxLength value="37"/>
                </xs:restriction>
        </xs:simpleType>

Discussion

  • Daniel Peintner

    Daniel Peintner - 2024-01-08

    You are correct, the test example is simply wrong.
    Note: I think this limitation evolved over time and the example did not reflect it accordingly.

    FYI: the EXI codec does not check for min/max character lengths.

    Do you plan to provide a fix (increasing size to min 3 and add proper characters)?

     
    • Gravis

      Gravis - 2024-01-08

      I hadn't even considered a fix because I wasn't 100% sure it was wrong or if I had missed something. I think a simple string like "abcdefg" would suffice.

      However, if what meant to ask if I was going to provide a patch for input validation, I'm not.

       

      Last edit: Gravis 2024-01-08
  • Daniel Peintner

    Daniel Peintner - 2024-02-14
    • status: open --> closed
     

Log in to post a comment.