Menu

#19 xmlsig test AuthorizationReq signatures failed

1.0
open
nobody
None
2022-08-19
2022-05-13
Anonymous
No

Hi,

        I use test/main_examplexmldsig_test file.The test results did not match expectations(ISO 15118-2:2014,Annex J  )

        errn = encode_iso2ExiFragment(&stream1, &exiV2G_AR); //encode_iso2ExiFragment or encode_iso1ExiFragment

when use iso1:
AuthorizationReq.Id len 3 :
AuthorizationReq.id=ID1
AuthorizationReq.GenChallenge len 16 :0x53,0x6f,0x6d,0x65,0x20,0x52,0x61,0x6e,0x64,0x6f,0x6d,0x20,0x44,0x61,0x74,0x61,
exiV2G_AR: 0x80,0x82,0x20,0xa9,0x28,0x86,0x2b,0xd0,
EXI1 stream length does not match !

when use iso2:
AuthorizationReq.Id len 3 :
AuthorizationReq.id=ID1
AuthorizationReq.GenChallenge len= 16 :0x53,0x6f,0x6d,0x65,0x20,0x52,0x61,0x6e,0x64,0x6f,0x6d,0x20,0x44,0x61,0x74,0x61,
exiV2G_AR: 0x80,0x05,0x80,0xa9,0x28,0x86,0x20,0x41,0x4d,0xbd,0xb5,0x94,0x81,0x49,0x85,0xb9,0x91,0xbd,0xb4,0x81,0x11,0x85,0xd1,0x84,0xb0,0x00,
EXI1 stream length does not match

expect result:
int isoStream1[] = {0x80, 0x04, 0x01, 0x52, 0x51, 0x0C, 0x40, 0x82, 0x9B, 0x7B, 0x6B, 0x29, 0x02, 0x93, 0x0B, 0x73, 0x23, 0x7B, 0x69, 0x02, 0x23, 0x0B, 0xA3, 0x09, 0xE8};

Regards
zhan

Discussion

  • Daniel Peintner

    Daniel Peintner - 2022-07-05

    Hi,

    ISO2 is not the latest XML schemas and is based on an intermediary XML schema.
    OpenV2G will no longer provide new updates as Open Source.

    If you are interested in a commercial solution, please contact us via exi.ct@siemens.com.

    -- Daniel

     
    • zhan yong

      zhan yong - 2022-07-27

      Hi, Daniel

          thanks for your reply.
      
           ISO2 will begin the development phase of the initiative to contact you.
      
         I want to know why the "XMLsig test demo" test fails in ISO1? The ISO2 API in the test case has been replaced with ISO1.
      
         Best,
        zhan
      
       

      Last edit: zhan yong 2022-07-27
  • Daniel Peintner

    Daniel Peintner - 2022-08-01

    Hi,

    Do you mean the following test method xmldsig_test() ?

    https://sourceforge.net/p/openv2g/code/HEAD/tree/trunk/src/test/main_example.c#l2343

    Using a different schema (e.g, ISO1 vs ISO2) changes the the result and also the digest value etc.

    -- Daniel

     
    • zhan yong

      zhan yong - 2022-08-16

      Hi,

          you are right,but I using "ISO15118-2:2014 Annex J Overview on XML Signatures"  The resulting EXI data mismatching. I use method "encode_iso1ExiFragment".
      
        original data:
         AuthorizationReq.id=ID1
      

      AuthorizationReq.GenChallenge :0x53,0x6f,0x6d,0x65,0x20,0x52,0x61,0x6e,0x64,0x6f,0x6d,0x20,0x44,0x61,0x74,0x61,

      Output results using encode_iso1ExiFragment methods.

        test output :0x80,0x82,0x20,0xa9,0x28,0x86,0x2b,0xd0,
        right output:0x80, 0x04, 0x01, 0x52, 0x51, 0x0C, 0x40, 0x82, 0x9B, 0x7B, 0x6B, 0x29, 0x02, 0x93, 0x0B, 0x73, 0x23, 0x7B, 0x69, 0x02, 0x23, 0x0B, 0xA3, 0x09, 0xE8
      
       
  • Daniel Peintner

    Daniel Peintner - 2022-08-17

    Hi,

    You are building a C struct that you pass to encode_iso1ExiFragment(...);
    Can you share the code for that or a reproducible example that allows me to look into...

    Thanks,

    -- Daniel

     
    • zhan yong

      zhan yong - 2022-08-18

      hi,

      thanks for your reply.
      

      Sorry, my problems, I build environment using openv2g v0.95 ,run environment using openv2g V0.94. both using V0.94 is right.

      And I want to make sure "AuthorizationReq.GenChallenge" fill origina data("Some Random Data"),ISO15118-2:2014 AnnexJ using base64 encode data ("Some Random Data" base64 encode).Did openv2g make this logic(base64 encode)?
      "SignedInfo.Reference.array[0].DigestValue" need fill origina data when using openv2g?
      "V2G_Message.Header.Signature.SignatureValue" neef  fill base64 encode data when using openv2g?
      
       
  • Daniel Peintner

    Daniel Peintner - 2022-08-19

    Hi,

    The OpenV2G library does not automatically fill data from one struct to the other or anything else that might be related to state-machine logic.
    OpenV2G expects you to fill data you want to transmit and it will encode it in EXI.

    I hope this helps,

    -- Daniel

     

Log in to post a comment.