summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2021-03-04 22:44:06 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-04-19 12:55:20 +0100
commit748958855900cf663a2656d2f27a7ab6edfc63eb (patch)
tree10d6bf99c0c9fbd4a485e4062fd1076cd8107011 /meta
parentee15a42fd0ad0f0cc021147bbe3084d040bbe6b0 (diff)
downloadpoky-748958855900cf663a2656d2f27a7ab6edfc63eb.tar.gz
cve-update-db-native: consider version suffix when update CVE db
some record from NVD can merge or split suffix from version, for example: CVE-2017-15906 "cpe23Uri" : "cpe:2.3:a:openbsd:openssh:5.0:p1:*:*:*:*:*:*" "cpe23Uri" : "cpe:2.3:a:openbsd:openssh:4.7p1:*:*:*:*:*:*:*" in such case include the suffix into version when update local CVE db. (From OE-Core rev: ecb41c87695c483959e2d96fcb6ca7cd92fd7315) Signed-off-by: Lee Chee Yang <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 13cc68197f81bb7c76fa1abecc5dd720b8bdb8d5) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb7
1 files changed, 6 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index cf62e1e32c..b3dc33734d 100644
--- a/meta/recipes-core/meta/cve-update-db-native.bb
+++ b/meta/recipes-core/meta/cve-update-db-native.bb
@@ -143,9 +143,14 @@ def parse_node_and_insert(c, node, cveId):
143 product = cpe23[4] 143 product = cpe23[4]
144 version = cpe23[5] 144 version = cpe23[5]
145 145
146 if cpe23[6] == '*' or cpe23[6] == '-':
147 version_suffix = ""
148 else:
149 version_suffix = "_" + cpe23[6]
150
146 if version != '*' and version != '-': 151 if version != '*' and version != '-':
147 # Version is defined, this is a '=' match 152 # Version is defined, this is a '=' match
148 yield [cveId, vendor, product, version, '=', '', ''] 153 yield [cveId, vendor, product, version + version_suffix, '=', '', '']
149 elif version == '-': 154 elif version == '-':
150 # no version information is available 155 # no version information is available
151 yield [cveId, vendor, product, version, '', '', ''] 156 yield [cveId, vendor, product, version, '', '', '']