TS 103 120 CR 133 - Other approach of digital signatures

Cryptographic operations like hashing and signing depend on that the target data does not change during serialization, transport or parsing. The current described “use of digital signatures” in Annex I uses the “detached content” method as described in Annex F of RFC 7515. This method assumes that the recipient can construct the exact payload as was used in the creation of the JWS signature. Since JSON doesn’t require object properties to be in any specific order and JSON also describes multiple ways of representing the same data, this may cause problems when verifying JWS signatures. This CR introduces an additional JSON Signature Scheme that ensures that recipients can perform verification of received signed data more reliably.

Merge request reports

Loading
+52
Changes for 103120/examples/json/response1_signed.json: 52 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core",
  "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
  "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common",
  "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task",
  "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation",
  "Header": {
    "SenderIdentifier": {
      "CountryCode": "XX",
      "UniqueIdentifier": "ACTOR01"
    },
    "ReceiverIdentifier": {
      "CountryCode": "XX",
      "UniqueIdentifier": "ACTOR02"
    },
    "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e",
    "Timestamp": "2015-09-01T12:00:01.000000Z",
    "Version": {
      "ETSIVersion": "V1.13.1",
      "NationalProfileOwner": "XX",
      "NationalProfileVersion": "v1.0"
    }
  },
  "Payload": {
    "ResponsePayload": {
      "ActionResponses": {
        "ActionResponse": [
          {
            "ActionIdentifier": 0,
            "CREATEResponse": {
              "Identifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045"
            }
          },
          {
            "ActionIdentifier": 1,
            "CREATEResponse": {
              "Identifier": "2b36a78b-b628-416d-bd22-404e68a0cd36"
            }
          }
        ]
      }
    }
  },
  "Signatures": [
    {
      "hash_algorithm": "sha-256",
      "algorithm": "Ed25519",
      "public_key": "MCowBQYDK2VwAyEAubMonBfU9pvIbj5RCiWQLD45Jvu6mKr+kQXjvjW8ZkU",
      "value": "B6vWORSsHlPfyHOvqEhnyH0vEVI90gfZADeP7uLQPOrYfDKMIZKopcnag9hZH0IrAZhgz5awTgt6AUfRX/fCCA=="
    }
  ]
}
+26
Changes for 103120/schema/json/ts_103120_Core.schema.json: 26 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -27,6 +27,32 @@
            "protected",
            "signature"
          ]
        },
        "Signatures": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "hash_algorithm": {
                "type": "string"
              },
              "algorithm": {
                "type": "string"
              },
              "public_key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "hash_algorithm",
              "algorithm",
              "value"
            ]
          }
        }
      },
      "required": [
+2
Changes for 103120/schema/xsd/ts_103120_Core.xsd: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
            <xs:element name="Signature" minOccurs="0"/>
            <!-- Use of the Signature element is discouraged – implementers are encouraged use the digsig:Signature element below instead -->
            <xs:element ref="digsig:Signature" minOccurs="0"/>
            <!-- The Signatures element is introduced for JSS support, and is not intended for use in XML-format instance documents.-->
            <xs:element name="Signatures" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="MessageHeader">
+9 −1
Changes for utils/translate_spec.py: 9 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -12,7 +12,13 @@ logging.basicConfig(level=logging.INFO)

json_signature_struct = {
    "properties": {"protected": {"type": "string"}, "signature": {"type": "string"}},
    "required": ["protected", "signature"],
    "required": ["protected", "signature"]
}

json_x590_signature_struct = {
    "type": "array", "minItems": 1, "items": {"type": "object",
    "properties": {"hash_algorithm": {"type": "string"}, "algorithm": {"type": "string"}, "public_key": {"type": "string"}, "value": {"type": "string"}  }
    "required": ["hash_algorithm", "algorithm", "value"] }
}


@@ -89,6 +95,8 @@ if __name__ == "__main__":
            js["$defs"]["HI1Message"]["patternProperties"] = {"^@": {"type": "string"}}
            js["$defs"]["HI1Message"]["properties"].pop("xmldsig:Signature")
            js["$defs"]["HI1Message"]["properties"]["Signature"] = json_signature_struct
            js["$defs"]["HI1Message"]["properties"]["Signatures"] = json_x590_signature_struct


        if "output" in ns_map[schema_tuple[0]]:
            js_path = Path(ns_map[schema_tuple[0]]["output"]) / convert_xsd_to_filename(
Loading