Add backend attribute in xml schema 32/189432/6
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Mon, 17 Sep 2018 15:09:47 +0000 (17:09 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Wed, 3 Oct 2018 10:58:44 +0000 (10:58 +0000)
Initial values may be saved in two locations: software backend and
hardware backend. Until now there were no way to choose backend of
to store initial values.

Change-Id: Iaee057e8c78f6d3066e119adcf4e6fe174846990

doc/example.xml
doc/initial_values.xsd

index 2be09cf..cccc214 100644 (file)
@@ -1,18 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<InitialValues version="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="initial_values.xsd">
+<InitialValues version="2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="initial_values.xsd">
   <!-- if EncryptionKey present, the content is an AES key encrypted using device key.
        The format is Base64(encrypt(AES_key_binary))
        i.e.:
            * RSA-OAEP encrypt AES key: openssl rsautl -encrypt -oaep -pubin -inkey device.pub -in encryption_AES_key -out encryption_AES_key.encrypted
            * encode base64: openssl enc -base64 -in encryption_AES_key.encrypted -->
-  <EncryptionKey>
-      QL/5RW1VfS1uya04CWkVy1eykdhnRaTFiQ6Lcv0XFYhqgUKp6+PxxT1xjaz8TCVp
-      UcKorZayMPCuStRAylViZfxHFhXKR3awH+FcnGMZrhV6kORy39YCba0NGc5eAk3s
-      CBPYdRRiV7ejJSOI8n3zFjituVhHLcLuZB6xHvQQpQFFYV0BuF3BXfx6roP4+Olj
-      bZ1fYDrj8QIzqi3RV/ORGbl1BqHVRoMN/5XB+8oVKVn/EMRZPao4hnkV3pTI01Ss
-      Wid4fIHzBpi8rkkxr80/ym2BkeA/piaPNGOQtKjVfBOn/SuR2LQJreG6QbI6MYXC
-      ZVOanzc0euaenw1q9b+yEQ==
-  </EncryptionKey>
   <Key name="key1" type="RSA_PUB" password="123">
     <PEM>
       -----BEGIN PUBLIC KEY-----
index 9a836fa..54672d9 100644 (file)
@@ -3,21 +3,25 @@
        <xsd:element name="InitialValues" type="InitialValuesType"></xsd:element>
 
        <xsd:complexType name="InitialValuesType">
-               <xsd:sequence maxOccurs="unbounded" minOccurs="1">
-                       <xsd:element name="EncryptionKey" maxOccurs="1" minOccurs="0"></xsd:element>
-                       <xsd:choice maxOccurs="1" minOccurs="1">
-                               <xsd:element name="Data" type="DataType"
-                                       maxOccurs="1" minOccurs="1">
-                               </xsd:element>
-                               <xsd:element name="Key" type="KeyType"
-                                       maxOccurs="1" minOccurs="1">
-                               </xsd:element>
-                               <xsd:element name="Cert" type="CertType"
-                                       maxOccurs="1" minOccurs="1">
-                               </xsd:element>
-                       </xsd:choice>
-               </xsd:sequence>
-               <xsd:attribute name="version" type="xsd:int" use="required"></xsd:attribute>
+               <xsd:choice maxOccurs="unbounded" minOccurs="1">
+                       <xsd:element name="Data" type="DataType"
+                               maxOccurs="1" minOccurs="1">
+                       </xsd:element>
+                       <xsd:element name="Key" type="KeyType"
+                               maxOccurs="1" minOccurs="1">
+                       </xsd:element>
+                       <xsd:element name="Cert" type="CertType"
+                               maxOccurs="1" minOccurs="1">
+                       </xsd:element>
+               </xsd:choice>
+               <xsd:attribute name="version" use="required">
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:int">
+                                       <xsd:minInclusive value="2"/>
+                                       <xsd:maxInclusive value="2"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:attribute>
        </xsd:complexType>
 
        <xsd:complexType name="ObjectType">
                                <xsd:restriction base="xsd:boolean"></xsd:restriction>
                        </xsd:simpleType>
                </xsd:attribute>
+               <xsd:attribute name="backend" use="optional">
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:enumeration value="software"/>
+                                       <xsd:enumeration value="hardware"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:attribute>
        </xsd:complexType>
 
        <xsd:complexType name="KeyType">