Skip to content

Commit 77ccb62

Browse files
Added CPE (2.2/2.3) and hash validation. Removed requirement on semver. Updated to RC1
1 parent e50061e commit 77ccb62

1 file changed

Lines changed: 20 additions & 9 deletions

File tree

schema/bom-1.0.xsd

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
targetNamespace="http://cyclonedx.org/schema/bom/1.0"
88
vc:minVersion="1.0"
99
vc:maxVersion="1.1"
10-
version="1.0-M2">
10+
version="1.0-RC1">
1111

1212
<xs:import namespace="http://cyclonedx.org/schema/spdx" schemaLocation="http://cyclonedx.org/schema/spdx"/>
1313

@@ -32,10 +32,10 @@
3232
of the component. Examples: commons-lang3 and jquery</xs:documentation>
3333
</xs:annotation>
3434
</xs:element>
35-
<xs:element name="version" type="bom:semver" minOccurs="1" maxOccurs="1">
35+
<xs:element name="version" type="xs:normalizedString" minOccurs="1" maxOccurs="1">
3636
<xs:annotation>
37-
<xs:documentation>The component version. The version should comply to the semantic versioning
38-
specification.</xs:documentation>
37+
<xs:documentation>The component version. The version should ideally comply with semantic versioning
38+
but is not enforced.</xs:documentation>
3939
</xs:annotation>
4040
</xs:element>
4141
<xs:element name="description" type="xs:normalizedString" minOccurs="0" maxOccurs="1">
@@ -85,7 +85,7 @@
8585
<xs:documentation>An optional copyright notice informing users of the underlying claims to copyright ownership in a published work.</xs:documentation>
8686
</xs:annotation>
8787
</xs:element>
88-
<xs:element name="cpe" type="xs:string" minOccurs="0" maxOccurs="1">
88+
<xs:element name="cpe" type="bom:cpe" minOccurs="0" maxOccurs="1">
8989
<xs:annotation>
9090
<xs:documentation>Specifies a well-formed CPE name. See https://nvd.nist.gov/products/cpe</xs:documentation>
9191
</xs:annotation>
@@ -142,7 +142,7 @@
142142
<xs:documentation>Specifies the file hash of the component</xs:documentation>
143143
</xs:annotation>
144144
<xs:simpleContent>
145-
<xs:extension base="xs:string">
145+
<xs:extension base="bom:hashValue">
146146
<xs:attribute name="alg" type="bom:hashAlg" use="required">
147147
<xs:annotation>
148148
<xs:documentation>Specifies the algorithm used to create hash</xs:documentation>
@@ -191,10 +191,21 @@
191191
<xs:enumeration value="SHA3-512"/>
192192
</xs:restriction>
193193
</xs:simpleType>
194-
195-
<xs:simpleType name="semver">
194+
195+
<xs:simpleType name="hashValue">
196196
<xs:restriction base="xs:token">
197-
<xs:pattern value="(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(-(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*)?(\+[0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*)?"/>
197+
<xs:pattern value="([a-fA-F0-9]{32})|([a-fA-F0-9]{40})|([a-fA-F0-9]{64})|([a-fA-F0-9]{128})"/>
198+
</xs:restriction>
199+
</xs:simpleType>
200+
201+
<xs:simpleType name="cpe">
202+
<xs:annotation>
203+
<xs:documentation xml:lang="en">
204+
Define the format for acceptable CPE URIs. Supports CPE 2.2 and CPE 2.3 formats. Refer to https://nvd.nist.gov/products/cpe for official specification.
205+
</xs:documentation>
206+
</xs:annotation>
207+
<xs:restriction base="xs:string">
208+
<xs:pattern value="([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9\._\-~%]*){0,6})|(cpe:2\.3:[aho\*\-](:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!&quot;#$$%&amp;'\(\)\+,/:;&lt;=&gt;@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-\._]|(\\[\\\*\?!&quot;#$$%&amp;'\(\)\+,/:;&lt;=&gt;@\[\]\^`\{\|}~]))+(\?*|\*?))|[\*\-])){4})"/>
198209
</xs:restriction>
199210
</xs:simpleType>
200211

0 commit comments

Comments
 (0)