lib: Add support to parse MS Catalog files
[amitay/samba.git] / lib / mscat / mscat.asn
1 --
2 --  ASN.1 Description for Microsoft Catalog Files
3 --
4 --    Copyright 2016 Andreas Schneider <asn@samba.org>
5 --    Copyright 2016 Nikos Mavrogiannopoulos <nmav@redhat.com>
6 --
7 --  This program is free software: you can redistribute it and/or modify
8 --  it under the terms of the GNU Lesser General Public License as published
9 --  by the Free Software Foundation, either version 3 of the License, or
10 --  (at your option) any later version.
11 --
12 --  This program is distributed in the hope that it will be useful,
13 --  but WITHOUT ANY WARRANTY; without even the implied warranty of
14 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 --  GNU Lesser General Public License for more details.
16 --
17 --  You should have received a copy of the GNU Lesser General Public License
18 --  along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 --
20 CATALOG {}
21 DEFINITIONS IMPLICIT TAGS ::= -- assuming implicit tags, should try explicit too
22
23 BEGIN
24
25 -- CATALOG_NAME_VALUE
26 CatalogNameValue ::= SEQUENCE { -- 180
27     name       BMPString,
28     flags      INTEGER, -- 10010001
29     value      OCTET STRING -- UTF-16-LE
30 }
31
32 -- CATALOG_MEMBER_INFO
33 CatalogMemberInfo ::= SEQUENCE {
34     name       BMPString,
35     id         INTEGER -- 0200
36 }
37
38 CatalogMemberInfo2 ::= SEQUENCE {
39     memId       OBJECT IDENTIFIER,
40     unknown     SET OF SpcLink
41 }
42
43 -- SPC_INDIRECT_DATA
44 SpcIndirectData ::= SEQUENCE {
45     data        SpcAttributeTypeAndOptionalValue,
46     messageDigest DigestInfo
47 }
48
49 SpcAttributeTypeAndOptionalValue ::= SEQUENCE {
50     type        OBJECT IDENTIFIER,
51     value       ANY DEFINED BY type OPTIONAL
52 }
53
54 DigestInfo ::= SEQUENCE {
55     digestAlgorithm AlgorithmIdentifier,
56     digest OCTET STRING
57 }
58
59 AlgorithmIdentifier ::=  SEQUENCE  {
60     algorithm   OBJECT IDENTIFIER,
61     parameters  ANY DEFINED BY algorithm OPTIONAL
62                 -- contains a value of the type
63 }
64
65 -- SPC_PE_IMAGE_DATA
66 SpcPEImageData ::= SEQUENCE {
67     flags       SpcPeImageFlags DEFAULT includeResources,
68     link        [0] EXPLICIT SpcLink OPTIONAL
69 }
70
71 SpcPeImageFlags ::= BIT STRING {
72     includeResources            (0),
73     includeDebugInfo            (1),
74     includeImportAddressTable   (2)
75 }
76
77 SpcLink ::= CHOICE {
78     url         [0]    IMPLICIT IA5String,
79     moniker     [1]    IMPLICIT SpcSerializedObject,
80     file        [2]    EXPLICIT SpcString
81 }
82
83 SpcSerializedObject ::= SEQUENCE {
84     classId     OCTET STRING, -- GUID
85     data        OCTET STRING  -- Binary structure
86 }
87
88 SpcString ::= CHOICE {
89     unicode     [0] IMPLICIT BMPString,
90     ascii       [1] IMPLICIT IA5String
91 }
92
93 -- SPC_IMAGE_DATA_FILE
94 SpcImageDataFile ::= SEQUENCE {
95     flags       BIT STRING,
96     file        SpcLink
97 }
98
99 -----------------------------------------------------------
100 -- CERT_TRUST_LIST STRUCTURE
101 -----------------------------------------------------------
102
103 CatalogListId ::= SEQUENCE {
104     oid OBJECT IDENTIFIER
105 }
106
107 CatalogListMemberId ::= SEQUENCE {
108     oid OBJECT IDENTIFIER,
109     optional NULL
110 }
111
112 MemberAttribute ::= SEQUENCE {
113     contentType OBJECT IDENTIFIER,
114     content SET OF ANY DEFINED BY contentType
115 }
116
117 CatalogListMember ::= SEQUENCE {
118     checksum OCTET STRING, -- The member checksum (e.g. SHA1)
119     attributes SET OF MemberAttribute OPTIONAL
120 }
121
122 CatalogAttribute ::= SEQUENCE {
123     dataId OBJECT IDENTIFIER,
124     encapsulated_data OCTET STRING -- encapsulates CatNameValue or SpcPeImageData
125 }
126
127 CertTrustList ::= SEQUENCE {
128     catalogListId CatalogListId,
129     unknownString OCTET STRING, -- 16 bytes MD5 hash?
130     trustUtcTime UTCTime,
131     catalogListMemberId CatalogListMemberId,
132     members SEQUENCE OF CatalogListMember,
133     attributes [0] EXPLICIT SEQUENCE OF CatalogAttribute OPTIONAL
134 }
135
136 END