ietf-wg-cellar / ebml-specification

the specification for the EBML format
Creative Commons Attribution 4.0 International
70 stars 24 forks source link

EBML spec? #391

Closed StefH closed 3 years ago

StefH commented 3 years ago

You have a Matroska xml file: https://github.com/ietf-wg-cellar/matroska-specification/blob/master/ebml_matroska.xml

But do you also have a xml file which describes the common EBML ?

robUx4 commented 3 years ago

(this issue is not Matroska related but EBML)

I thought we had such a document but we don't. That's indeed something we should have.

StefH commented 3 years ago

@robUx4 : if you can find this, this would be cool!

StefH commented 3 years ago

Based on this : https://github.com/MideTechnology/ebmlite/blob/13bd11e3a77cb933400952ddfb06986120344c6a/ebmlite/schemata/matroska.xml

I created this file:

<EBMLSchema xmlns="urn:ietf:rfc:8794" docType="ebml" version="?">
  <element name="Void" path="\Void" id="0xEC" type="binary">
    <documentation lang="en" purpose="definition">Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use.</documentation>
  </element>
  <element name="CRC-32" path="\CRC-32" id="0xBF" type="binary">
    <documentation lang="en" purpose="definition">The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian.</documentation>
  </element>
  <element name="EBML" path="\EBML" id="0x1A45DFA3" type="master" minOccurs="1" maxOccurs="1" unknownsizeallowed="1">
    <documentation lang="en" purpose="definition">Set the EBML characteristics of the data to follow. Each EBML document has to start with this.</documentation>
  </element>
  <element name="EBMLVersion" path="\EBML\EBMLVersion" id="0x4286" type="uinteger" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The version of EBML parser used to create the file.</documentation>
  </element>
  <element name="EBMLReadVersion" path="\EBML\EBMLReadVersion" id="0x42F7" type="uinteger" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The minimum EBML version a parser has to support to read this file.</documentation>
  </element>
  <element name="EBMLMaxIDLength" path="\EBML\EBMLMaxIDLength" id="0x42F2" type="uinteger" range="4" default="4" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The maximum length of the IDs you'll find in this file (4 or less in Matroska).</documentation>
  </element>
  <element name="EBMLMaxSizeLength" path="\EBML\EBMLMaxSizeLength" id="0x42F3" type="uinteger" range="1-8" default="8" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The maximum length of the sizes you'll find in this file (8 or less in Matroska). This does not override the element size indicated at the beginning of an element. Elements that have an indicated size which is larger than what is allowed by EBMLMaxSizeLength shall be considered invalid.</documentation>
  </element>
  <element name="DocType" path="\EBML\DocType" id="0x4282" type="string" default="matroska" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files.</documentation>
  </element>
  <element name="DocTypeVersion" path="\EBML\DocTypeVersion" id="0x4287" type="uinteger" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The version of DocType interpreter used to create the file.</documentation>
  </element>
  <element name="DocTypeReadVersion" path="\EBML\DocTypeReadVersion" id="0x4285" type="uinteger" minOccurs="1" maxOccurs="1">
    <documentation lang="en" purpose="definition">The minimum DocType version an interpreter has to support to read this file.</documentation>
  </element>

  <element name="SignatureSlot" path="\EBML\SignatureSlot" id="0x1B538667" type="master" multiple="1">
    <documentation lang="en" purpose="definition">Contain signature of some (coming) elements in the stream.</documentation>
  </element>
  <element name="SignatureAlgo" path="\EBML\SignatureSlot\SignatureAlgo" id="0x7E8A" type="uinteger">
    <documentation lang="en" purpose="definition">Signature algorithm used (1=RSA, 2=elliptic).</documentation>
  </element>
  <element name="SignatureHash" path="\EBML\SignatureSlot\SignatureHash" id="0x7E9A" type="uinteger">
    <documentation lang="en" purpose="definition">Hash algorithm used (1=SHA1-160, 2=MD5).</documentation>
  </element>
  <element name="SignaturePublicKey" path="\EBML\SignatureSlot\SignaturePublicKey" id="0x7EA5" type="binary">
    <documentation lang="en" purpose="definition">The public key to use with the algorithm (in the case of a PKI-based signature).</documentation>
  </element>
  <element name="Signature" path="\EBML\SignatureSlot\Signature" id="0x7EB5" type="binary">
    <documentation lang="en" purpose="definition">The signature of the data (until a new.</documentation>
  </element>

  <element name="SignatureElements" path="\EBML\SignatureElements" id="0x7E5B" type="master">
    <documentation lang="en" purpose="definition">Contains elements that will be used to compute the signature.</documentation>
  </element>
  <element name="SignatureElementList" path="\EBML\SignatureElements\SignatureElementList" id="0x7E7B" type="master" multiple="1">
    <documentation lang="en" purpose="definition">
      A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: Cluster|Block|BlockAdditional means that the BlockAdditional of all Blocks in all Clusters is used for encryption.
    </documentation>
  </element>
  <element name="SignedElement" path="\EBML\SignatureElements\SignedElement" id="0x6532" type="binary" multiple="1" >
    <documentation lang="en" purpose="definition">An element ID whose data will be used to compute the signature.</documentation>
  </element>

</EBMLSchema>

Can you please review?

robUx4 commented 3 years ago

It would be better to create a Pull Request to add it to this repository for review. Commenting on GitHub is not the most practical way.

StefH commented 3 years ago

@robUx4 See my PR https://github.com/ietf-wg-cellar/ebml-specification/pull/392