smuellerDD / acvpparser

ACVP Parser for invocation of cryptographic implementations using the ACVP JSON test vectors
https://www.chronox.de/acvpparser
Other
36 stars 27 forks source link

Help with usage #5

Closed DekraTC closed 4 years ago

DekraTC commented 4 years ago

I'm trying to use the acvp-parser to solve a vector downloaded form the demo server. No response is produced:

[root@localhost acvpparser]# ./acvp-parser ~/vectors/demo/req/hash.req hash.rsp -vvv
ACVPParser (09:51:54) Debug: Request file /root/vectors/demo/req/hash.req read successfully
ACVPParser (09:51:54) Warning: No data found in ACVP server response: [
{
    "jwt":"XXXXXXXXXXXXXXXXXXXX",
    "url":"\/acvp\/v1\/testSessions\/99631",
    "vectorSetUrls":[
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288635",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288636",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288637",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288638",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288639",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288640",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288641",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288642",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288643",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288644",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288645"
    ]
  },
  {
    "vsId":288635,
    "algorithm":"SHA-1",
    "revision":"1.0",
    "isSample":false,
    "testGroups":[
      {
        "tgId":1,
        "testType":"AFT",
        "tests":[
          {
            "tcId":1,
            "msg":"",
            "len":0
          },
          {
            "tcId":2,
            "msg":"",
            "len":0
          },
          {
            "tcId":3,
            "msg":"60",
            "len":8
          },
          {
            "tcId":4,
            "msg":"8CFC",
            "len":16
          },
          {
            "tcId":5,
            "msg":"C4940B",
            "len":24
          },
          {
            "tcId":6,
            "msg":"D09B9678",
            "len":32
          },
          {
            "tcId":7,
            "msg":"A7759D4F9E",
            "len":40
          },
          {
            "tcId":8,
            "msg":"0CC11A3FAAB7",
            "len":48
          },
          {
            "tcId":9,
            "msg":"AA9F3298119F07",
            "len":56
          },
          {
            "tcId":10,
            "msg":"B1864EE187520915",
            "len":64
          },
          {
            "tcId":11,
            "msg":"707E7E087A2B3AF3EC",
            "len":72
          },
          {
            "tcId":12,
            "msg":"0C290728976250CACEF6",
            "len":80
          },
          {
            "tcId":13,
            "msg":"0AF64E6FA10FB04337390F",
            "len":88
          },
          {
            "tcId":14,
            "msg":"2E228A25BD690B80D3CDF95F",
            "len":96
          },
          {
            "tcId":15,
            "msg":"F713A603D2EE928E4040CE4BAC",
            "len":104
          },
          {
            "tcId":16,
            "msg":"B8E7066241A7D2E9ADDE4B79A3AC",
            "len":112
          },
          {
            "tcId":17,
            "msg":"CD44AD099BA5FE38539BF0931DDAB9",
            "len":120
          },
          {
            "tcId":18,
            "msg":"430DFC10D011331F90227F7B0CF6D633",
            "len":128
          },
          {
            "tcId":19,
            "msg":"37665034F50A12B763A4A46B0153231512",
            "len":136
          },
          {
            "tcId":20,
            "msg":"CAACDD5281E62136C2C90D8F3C5C1CCD30B5",
            "len":144
          },
          {
            "tcId":21,
            "msg":"C6FD60432F4A2E8A6D5ECE661ACD1DDD43135E",
            "len":152
          },
          {
            "tcId":22,
            "msg":"90D636683F883AA52BDA2B538E4EB41F5FAD56A1",
            "len":160
          },
          {
            "tcId":23,
            "msg":"ED79D74DA8DDC63F542D0D62B7F061E344EEF496F4",
            "len":168
          },[root@localhost acvpparser]#

I don't see any error and I don't really understand the warning.

Maybe I should be using another command/option? I expected the acvpparser to create a file "hash.rsp" with the json containing the "md"s of the input file vectors.

smuellerDD commented 4 years ago

Am Freitag, 4. September 2020, 10:06:13 CEST schrieb DekraTC:

Hi DekraTC,

I'm trying to use the acvp-parser to solve a vector downloaded form the demo server. No response is produced:

You seem to have it downloaded using the libacvp. This library adds additional meta data to the file that is not defined in ACVP.

The parser currently requires a fully compliant ACVP vector as produced by the ACVP server.

That said, either you use the ACVP Proxy to get and post the test data or you modify the received vectors as follows:


[root@localhost acvpparser]# ./acvp-parser ~/vectors/demo/req/hash.req
hash.rsp -vvv ACVPParser (09:51:54) Debug: Request file
/root/vectors/demo/req/hash.req read successfully ACVPParser (09:51:54)
Warning: No data found in ACVP server response: [ {
    "jwt":"XXXXXXXXXXXXXXXXXXXX",
    "url":"\/acvp\/v1\/testSessions\/99631",
    "vectorSetUrls":[
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288635",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288636",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288637",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288638",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288639",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288640",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288641",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288642",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288643",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288644",
      "\/acvp\/v1\/testSessions\/99631\/vectorSets\/288645"
    ]
  },

Remove the entire top part which is the additional data from libacvp.

And remove the trailing sqare bracket at the end of the file.

The libacvp output file is the following JSON structure:

[ { libacvp meta data}, {test vector data} ]

The ACVP Parser only needs the {test vector data} which is the data received from the ACVP server.

That said, the resulting data does not contain the libacvp meta data either. So, the resulting test response now need to be massaged to re-add that data if you want to process it with libacvp.

{ "vsId":288635, "algorithm":"SHA-1", "revision":"1.0", "isSample":false, "testGroups":[ { "tgId":1, "testType":"AFT", "tests":[ { "tcId":1, "msg":"", "len":0 }, { "tcId":2, "msg":"", "len":0 }, { "tcId":3, "msg":"60", "len":8 }, { "tcId":4, "msg":"8CFC", "len":16 }, { "tcId":5, "msg":"C4940B", "len":24 }, { "tcId":6, "msg":"D09B9678", "len":32 }, { "tcId":7, "msg":"A7759D4F9E", "len":40 }, { "tcId":8, "msg":"0CC11A3FAAB7", "len":48 }, { "tcId":9, "msg":"AA9F3298119F07", "len":56 }, { "tcId":10, "msg":"B1864EE187520915", "len":64 }, { "tcId":11, "msg":"707E7E087A2B3AF3EC", "len":72 }, { "tcId":12, "msg":"0C290728976250CACEF6", "len":80 }, { "tcId":13, "msg":"0AF64E6FA10FB04337390F", "len":88 }, { "tcId":14, "msg":"2E228A25BD690B80D3CDF95F", "len":96 }, { "tcId":15, "msg":"F713A603D2EE928E4040CE4BAC", "len":104 }, { "tcId":16, "msg":"B8E7066241A7D2E9ADDE4B79A3AC", "len":112 }, { "tcId":17, "msg":"CD44AD099BA5FE38539BF0931DDAB9", "len":120 }, { "tcId":18, "msg":"430DFC10D011331F90227F7B0CF6D633", "len":128 }, { "tcId":19, "msg":"37665034F50A12B763A4A46B0153231512", "len":136 }, { "tcId":20, "msg":"CAACDD5281E62136C2C90D8F3C5C1CCD30B5", "len":144 }, { "tcId":21, "msg":"C6FD60432F4A2E8A6D5ECE661ACD1DDD43135E", "len":152 }, { "tcId":22, "msg":"90D636683F883AA52BDA2B538E4EB41F5FAD56A1", "len":160 }, { "tcId":23, "msg":"ED79D74DA8DDC63F542D0D62B7F061E344EEF496F4", "len":168 },[root@localhost acvpparser]#


I don't see any error and I don't really understand the warning.

Maybe I should be using another command/option?
I expected the acvpparser to create a file "hash.rsp" with the json
containing the "md"s of the input file vectors.

Ciao Stephan

DekraTC commented 4 years ago

Thank you very much!