Merge ubuntu-cve-tracker:fixup-fixup into ubuntu-cve-tracker:master

Proposed by Marc Deslauriers
Status: Merged
Merge reported by: Marc Deslauriers
Merged at revision: 5141fa1dbe24201c81069ba3b2d5fa20f5b493e5
Proposed branch: ubuntu-cve-tracker:fixup-fixup
Merge into: ubuntu-cve-tracker:master
Diff against target: 2340 lines (+1781/-275)
25 files modified
dev/null (+0/-233)
scripts/check-syntax (+133/-18)
scripts/cve_lib.py (+79/-9)
scripts/test_cve_lib.py (+86/-15)
scripts/testfiles/cve_lib_test.example (+71/-0)
scripts/testfiles/cve_lib_test_1.in (+70/-0)
scripts/testfiles/cve_lib_test_1.result (+71/-0)
scripts/testfiles/cve_lib_test_10.in (+71/-0)
scripts/testfiles/cve_lib_test_10.result (+70/-0)
scripts/testfiles/cve_lib_test_2.in (+70/-0)
scripts/testfiles/cve_lib_test_2.result (+71/-0)
scripts/testfiles/cve_lib_test_3.in (+70/-0)
scripts/testfiles/cve_lib_test_3.result (+71/-0)
scripts/testfiles/cve_lib_test_4.in (+70/-0)
scripts/testfiles/cve_lib_test_4.result (+71/-0)
scripts/testfiles/cve_lib_test_5.in (+70/-0)
scripts/testfiles/cve_lib_test_5.result (+71/-0)
scripts/testfiles/cve_lib_test_6.in (+70/-0)
scripts/testfiles/cve_lib_test_6.result (+71/-0)
scripts/testfiles/cve_lib_test_7.in (+71/-0)
scripts/testfiles/cve_lib_test_7.result (+71/-0)
scripts/testfiles/cve_lib_test_8.in (+71/-0)
scripts/testfiles/cve_lib_test_8.result (+71/-0)
scripts/testfiles/cve_lib_test_9.in (+70/-0)
scripts/testfiles/cve_lib_test_9.result (+71/-0)
Reviewer Review Type Date Requested Status
Rodrigo Figueiredo Zaiden Approve
Review via email: mp+460700@code.launchpad.net

Commit message

This series of commits removes the hackish check-syntax-fixup script and adds proper --autofix and --dry-run options to the check-syntax script itself.

To post a comment you must log in.
Revision history for this message
Rodrigo Figueiredo Zaiden (rodrigo-zaiden) wrote :

LGTM, thanks for this.
it is of great help that the fix script can now fix all complains at once, and much faster.

review: Approve
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

thanks for the review! :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/scripts/check-syntax b/scripts/check-syntax
index 3d7ee58..d253622 100755
--- a/scripts/check-syntax
+++ b/scripts/check-syntax
@@ -242,6 +242,19 @@ parser.add_option(
242 default=False,242 default=False,
243)243)
244parser.add_option(244parser.add_option(
245 "-a",
246 "--autofix",
247 help="Attempt to fix problems automatically",
248 action="store_true",
249 default=False,
250)
251parser.add_option(
252 "--dry-run",
253 help="Dry run for autofix parameter",
254 action="store_true",
255 default=False,
256)
257parser.add_option(
245 "-j",258 "-j",
246 "--jobs",259 "--jobs",
247 type=int,260 type=int,
@@ -383,6 +396,103 @@ if len(cna_cves_set) > 0 and all_files:
383396
384aliases_cache = {}397aliases_cache = {}
385398
399def fixup_entry(filename, pkg, rel):
400 # If release is devel or EOL, we should add the proper status instead of removing
401 if rel == cve_lib.devel_release:
402 rel = "devel"
403 if opt.dry_run:
404 print("Dry-Run: updating %s, %s, devel to DNE" % (filename, pkg))
405 return
406 cve_lib.update_state(filename, pkg, "devel", "DNE")
407 elif not cve_lib.is_active_release(rel):
408 if cve_lib.is_active_esm_release(rel):
409 status = cve_lib.EOL_ESM_STATUS.format(state='unknown')
410 else:
411 status = cve_lib.EOL_STATUS.format(state='unknown')
412
413 if opt.dry_run:
414 print("Dry-Run: updating %s, %s, %s to %s" % (filename, pkg, rel, status))
415 return
416 cve_lib.update_state(filename, pkg, rel, status)
417
418 else:
419 if opt.dry_run:
420 print("Dry-Run: dropping %s, %s, %s" % (filename, pkg, rel))
421 return
422 cve_lib.drop_pkg_release(filename, pkg, rel)
423
424def fixup_entry_state(filename, pkg, rel, state):
425 if opt.dry_run:
426 print("Dry-Run: updating %s, %s, %s to %s" % (filename, pkg, rel, state))
427 return
428
429 cve_lib.update_state(filename, pkg, rel, state)
430
431def fixup_entry_get_status(filename, pkg, rel):
432 # get status from the parent release if there is one
433 status = "needs-triage"
434 try:
435 _, _, _, details = cve_lib.get_subproject_details(rel)
436 parent = details["parent"]
437 # this may be either an alias or a full name but cve_lib only
438 # uses aliases
439 parent = cve_lib.release_alias(parent)
440 data = cve_lib.load_cve(filename)
441 status = data["pkgs"][pkg][parent][0]
442 note = data["pkgs"][pkg][parent][1]
443 if len(note) > 0:
444 status = status + " (" + note + ")"
445 # if parent reached EOL then we are likely the new alive
446 # release so ignore their status in that case
447 if "end of life" in status or "end of standard support" in status:
448 status = 'needs-triage'
449 except (KeyError, ValueError, TypeError):
450 pass
451
452 return status
453
454def fixup_entry_missing(filename, pkg, rel):
455 status = fixup_entry_get_status(filename, pkg, rel)
456
457 if rel == cve_lib.devel_release:
458 rel = "devel"
459
460 if opt.dry_run:
461 print("Dry-Run: Adding %s, %s, %s to %s" % (filename, pkg, rel, status))
462 return
463
464 cve_lib.add_state(filename, pkg, rel, status)
465
466def fixup_entry_wrong(filename, pkg, rel):
467 status = fixup_entry_get_status(filename, pkg, rel)
468
469 if rel == cve_lib.devel_release:
470 rel = "devel"
471
472 if opt.dry_run:
473 print("Dry-Run: updating %s, %s, %s to %s" % (filename, pkg, rel, status))
474 return
475
476 cve_lib.update_state(filename, pkg, rel, status, None)
477
478def get_cve_path(cve, rel):
479
480 cve = os.path.basename(cve)
481 if rel in cve_lib.external_releases:
482 # FIXME: Should we also be using get_external_subproject_dir here?
483 cvepath = os.path.join(
484 cve_lib.get_external_subproject_cve_dir(rel), cve
485 )
486 else:
487 # Try and find where this CVE is located
488 for d in cve_lib.cve_dirs:
489 cvepath = os.path.join(d, cve)
490 if os.path.exists(cvepath):
491 return cvepath
492 # Fall back to the active directory if that didn't work?
493 cvepath = os.path.join(cve_lib.active_dir, cve)
494 return cvepath
495
386def check_cve(cve):496def check_cve(cve):
387 if re.match(r"EMB-", cve):497 if re.match(r"EMB-", cve):
388 cvepath = os.path.join(cve_lib.embargoed_dir, cve)498 cvepath = os.path.join(cve_lib.embargoed_dir, cve)
@@ -447,9 +557,6 @@ def check_cve(cve):
447 # Verify have required releases for each package557 # Verify have required releases for each package
448 listed_releases = set(sorted(data["pkgs"][pkg].keys()))558 listed_releases = set(sorted(data["pkgs"][pkg].keys()))
449 all_required_releases = (set(cve_lib.all_releases + ["devel"]) - set([cve_lib.devel_release])) - set(cve_lib.eol_releases)559 all_required_releases = (set(cve_lib.all_releases + ["devel"]) - set([cve_lib.devel_release])) - set(cve_lib.eol_releases)
450 # get the name of a release which is listed in the CVE so we can
451 # place the generated error message on this release's line etc
452 nearby_rel = list(listed_releases)[0]
453 aliases_releases = set()560 aliases_releases = set()
454561
455 listed_series = set()562 listed_series = set()
@@ -486,12 +593,10 @@ def check_cve(cve):
486593
487 for pkg_alias in pkgs_from_aliases:594 for pkg_alias in pkgs_from_aliases:
488 if pkg_alias not in data["pkgs"].keys():595 if pkg_alias not in data["pkgs"].keys():
489 filename = srcmap["pkgs"][pkg][nearby_rel][0]596 filename = get_cve_path(cve, rel)
490 linenum = srcmap["pkgs"][pkg][nearby_rel][1]
491 print(597 print(
492 "%s: %d: %s missing release '%s'"598 "%s: %s missing release '%s'"
493 # put the error on a line near where this entry should go599 % (filename, pkg_alias, rel),
494 % (filename, linenum, pkg_alias, rel),
495 file=sys.stderr,600 file=sys.stderr,
496 )601 )
497 cve_okay = False602 cve_okay = False
@@ -501,15 +606,13 @@ def check_cve(cve):
501 if aliases:606 if aliases:
502 if rel in listed_releases and pkg \607 if rel in listed_releases and pkg \
503 not in pkgs_from_aliases:608 not in pkgs_from_aliases:
504 filename = srcmap["pkgs"][pkg][nearby_rel][0]609 filename = get_cve_path(cve, rel)
505 linenum = srcmap["pkgs"][pkg][nearby_rel][1]
506 print(610 print(
507 "%s: %d: package '%s' not in '%s'"611 "%s: package '%s' not in '%s'"
508 % (filename, linenum, pkg, rel),612 % (filename, pkg, rel),
509 file=sys.stderr,613 file=sys.stderr,
510 )614 )
511 missing_releases = all_required_releases - listed_releases615 missing_releases = all_required_releases - listed_releases
512 nearby_rel = list(listed_releases - missing_releases)[0]
513 for rel in missing_releases:616 for rel in missing_releases:
514 # only warn on active CVEs617 # only warn on active CVEs
515 if is_active(cve) and \618 if is_active(cve) and \
@@ -519,14 +622,14 @@ def check_cve(cve):
519 # we shouldn't add any entries to the CVE622 # we shouldn't add any entries to the CVE
520 if not cve_lib.is_cve_triage_required(rel): continue623 if not cve_lib.is_cve_triage_required(rel): continue
521624
522 filename = srcmap["pkgs"][pkg][nearby_rel][0]625 filename = get_cve_path(cve, rel)
523 linenum = srcmap["pkgs"][pkg][nearby_rel][1]
524 print(626 print(
525 "%s: %d: %s missing release '%s'"627 "%s: %s missing release '%s'"
526 # put the error on a line near where this entry should go628 % (filename, pkg, rel),
527 % (filename, linenum, pkg, rel),
528 file=sys.stderr,629 file=sys.stderr,
529 )630 )
631 if opt.autofix:
632 fixup_entry_missing(filename, pkg, rel)
530 cve_okay = False633 cve_okay = False
531 unknown_releases = listed_releases - set(cve_lib.all_releases + ["devel", "upstream"])634 unknown_releases = listed_releases - set(cve_lib.all_releases + ["devel", "upstream"])
532 for rel in unknown_releases:635 for rel in unknown_releases:
@@ -537,6 +640,8 @@ def check_cve(cve):
537 % (filename, linenum, pkg, rel),640 % (filename, linenum, pkg, rel),
538 file=sys.stderr,641 file=sys.stderr,
539 )642 )
643 if opt.autofix:
644 fixup_entry(filename, pkg, rel)
540 cve_okay = False645 cve_okay = False
541 for release in sorted(data["pkgs"][pkg].keys()):646 for release in sorted(data["pkgs"][pkg].keys()):
542 rel = release647 rel = release
@@ -590,6 +695,8 @@ def check_cve(cve):
590 % (filename, linenum, pkg, state, rel, fixed_state),695 % (filename, linenum, pkg, state, rel, fixed_state),
591 file=sys.stderr,696 file=sys.stderr,
592 )697 )
698 if opt.autofix:
699 fixup_entry_state(filename, pkg, rel, fixed_state)
593 cve_okay = False700 cve_okay = False
594 # REMOVED THIS CHECK TEMPORARILY WHILE WE WORK IN ANOTHER SOLUTION701 # REMOVED THIS CHECK TEMPORARILY WHILE WE WORK IN ANOTHER SOLUTION
595 # elif state == 'ignored':702 # elif state == 'ignored':
@@ -601,6 +708,8 @@ def check_cve(cve):
601 # % (filename, linenum, pkg, details[1], rel, fixed_state),708 # % (filename, linenum, pkg, details[1], rel, fixed_state),
602 # file=sys.stderr,709 # file=sys.stderr,
603 # )710 # )
711 # if opt.autofix:
712 # fixup_entry_state(filename, pkg, rel, fixed_state)
604 # cve_okay = False713 # cve_okay = False
605 continue714 continue
606715
@@ -625,6 +734,8 @@ def check_cve(cve):
625 % (filename, linenum, pkg, rel),734 % (filename, linenum, pkg, rel),
626 file=sys.stderr,735 file=sys.stderr,
627 )736 )
737 if opt.autofix:
738 fixup_entry_wrong(filename, pkg, rel)
628 cve_okay = False739 cve_okay = False
629 continue740 continue
630741
@@ -667,6 +778,8 @@ def check_cve(cve):
667 % (filename, linenum, pkg, rel),778 % (filename, linenum, pkg, rel),
668 file=sys.stderr,779 file=sys.stderr,
669 )780 )
781 if opt.autofix:
782 fixup_entry(filename, pkg, rel)
670 cve_okay = False783 cve_okay = False
671 else:784 else:
672 if rel in source:785 if rel in source:
@@ -703,6 +816,8 @@ def check_cve(cve):
703 % (filename, linenum, pkg, rel),816 % (filename, linenum, pkg, rel),
704 file=sys.stderr,817 file=sys.stderr,
705 )818 )
819 if opt.autofix:
820 fixup_entry(filename, pkg, rel)
706 cve_okay = False821 cve_okay = False
707 elif opt.strict and not opt.newer:822 elif opt.strict and not opt.newer:
708 # Validate the version is <= version in release823 # Validate the version is <= version in release
diff --git a/scripts/check-syntax-fixup b/scripts/check-syntax-fixup
709deleted file mode 100755824deleted file mode 100755
index 0ce195b..0000000
--- a/scripts/check-syntax-fixup
+++ /dev/null
@@ -1,233 +0,0 @@
1#!/usr/bin/env python3
2
3# Author: Alex Murray <alex.murray@canonical.com>
4# Copyright (C) 2021 Canonical Ltd.
5#
6# This script is distributed under the terms and conditions of the GNU General
7# Public License, Version 2 or later. See http://www.gnu.org/copyleft/gpl.html
8# for details.
9
10#
11# This script uses the output of check-syntax to determine what needs to
12# be fixed. Typical usage is:
13#
14# ./scripts/check-syntax 2>&1 | ./scripts/check-syntax-fixup
15#
16
17import argparse
18import os
19import sys
20import cve_lib
21
22
23def insert_into_file(filename: str, linenum: int, line: str, dryrun=False, verbose=False):
24 """Insert line into filename at linenum."""
25 if not dryrun:
26 # file may not already exist
27 contents = []
28 try:
29 with open(filename, "r") as f:
30 contents = f.readlines()
31 except FileNotFoundError:
32 pass
33 if verbose:
34 print("%s: %d: inserting '%s'" % (os.path.relpath(filename), linenum, line.strip()))
35 # linenum is 1 based but arrays are 0-based
36 contents.insert(linenum - 1, line)
37 with open(cve, "w") as f:
38 f.write("".join(contents))
39 else:
40 print("%s: %d: would insert '%s'" % (os.path.relpath(filename), linenum, line.strip()))
41
42
43def delete_from_file(filename: str, linenum: int, dryrun=False, verbose=False):
44 """Delete line at linenum from filename."""
45 if not dryrun:
46 # file may not already exist
47 contents = []
48 try:
49 with open(filename, "r") as f:
50 contents = f.readlines()
51 except FileNotFoundError:
52 pass
53 if verbose:
54 print("%s: %d: deleting... " % (os.path.relpath(filename), linenum))
55 # linenum is 1 based but arrays are 0-based
56 del contents[linenum - 1]
57 with open(cve, "w") as f:
58 f.write("".join(contents))
59 else:
60 print("%s: %d: would delete this line" % (os.path.relpath(filename), linenum))
61
62
63def identify_subproject_line_number(filename: str, pkg: str, rel: str):
64 # file may not already exist
65 contents = []
66 try:
67 with open(filename, "r") as f:
68 contents = f.readlines()
69 except FileNotFoundError:
70 pass
71
72 for linenum,line in enumerate(contents):
73 if not line or ':' not in line or '_' not in line:
74 continue
75 line_rel, line_pkg = line.split(":")[0].split('_', maxsplit=1)
76 if pkg == line_pkg and rel == line_rel:
77 return linenum + 1
78
79 return -1
80
81def get_pkg_rel_from_msg(msg):
82 parts = msg.split(" ")
83 if 'DOES exist' in msg or 'not in' in msg:
84 pkg = parts[1].replace("'", "")
85 rel = parts[-1].replace("'", "")
86 elif 'unknown package' in msg:
87 pkg = parts[2].replace("'", "")
88 rel = parts[-1].replace("'", "")
89 elif 'incorrect' in msg:
90 pkg = parts[0].replace("'", "")
91 rel = msg.split(', try')[0].split(' ')[-1].replace("'", "")
92 else:
93 pkg = parts[0]
94 rel = parts[-1].replace("'", "")
95 return pkg, rel
96
97parser = argparse.ArgumentParser("Automatically fixup issues flagged by check-syntax")
98parser.add_argument(
99 "-n",
100 "--dry-run",
101 action="store_true",
102 default=False,
103 help="Don't perform any actual modifications just print what would be done.",
104)
105parser.add_argument(
106 "-v",
107 "--verbose",
108 action="store_true",
109 default=False,
110 help="Print output for each operation performed.",
111)
112parser.add_argument(
113 "infile",
114 nargs="?",
115 help="File to read input from. Defaults to stdin.",
116 type=argparse.FileType("r"),
117 default=sys.stdin,
118)
119args = parser.parse_args()
120if args.dry_run:
121 print("DRY RUN - LIKE THE MATRIX, THIS IS JUST A SIMULATION.")
122
123
124modified = []
125
126for line in args.infile:
127 # skip warnings
128 if line.startswith("WARNING:"):
129 continue
130 # parse out file name, line number, and message
131 parts = line.split(":")
132 if len(parts) != 3:
133 continue
134 # strip whitespace from all parts
135 parts = map(lambda s: s.strip(), parts)
136 cve, linenum, msg = parts
137 linenum = int(linenum)
138
139 # don't modify a file more than once otherwise the line numbers get out of whack
140 if cve in modified:
141 # print unhandled lines
142 print(line, file=sys.stderr)
143 continue
144
145 if "missing release" in msg or 'DOES exist' in msg:
146 # e.g. golang missing release 'gke/gke-1.19'
147 # e.g. package 'libextractor' DOES exist in 'trusty/esm'
148 pkg, rel = get_pkg_rel_from_msg(msg)
149
150 # get status from the parent release if there is one
151 status = "needs-triage"
152 try:
153 _, _, _, details = cve_lib.get_subproject_details(rel)
154 parent = details["parent"]
155 # this may be either an alias or a full name but cve_lib only
156 # uses aliases
157 parent = cve_lib.release_alias(parent)
158 data = cve_lib.load_cve(cve)
159 status = data["pkgs"][pkg][parent][0]
160 note = data["pkgs"][pkg][parent][1]
161 if len(note) > 0:
162 status = status + " (" + note + ")"
163 # if parent reached EOL then we are likely the new alive
164 # release so ignore their status in that case
165 if "end of life" in status or "end of standard support" in status:
166 status = 'needs-triage'
167 except (KeyError, ValueError, TypeError):
168 pass
169
170 if rel == cve_lib.devel_release:
171 rel = "devel"
172
173 fixup = "{rel}_{pkg}: {status}\n".format(rel=rel, pkg=pkg, status=status)
174
175 # remove this hard-coded hack one-day...
176 if rel in cve_lib.external_releases or \
177 (rel == "trusty/esm" and "DOES exist" in msg):
178 cve = os.path.join(
179 cve_lib.get_external_subproject_cve_dir(rel), os.path.basename(cve)
180 )
181 linenum = identify_subproject_line_number(cve, pkg, rel)
182 if linenum == -1:
183 if 'DOES exist' in msg:
184 continue
185 linenum = 1 # We are inserting
186
187 # Remove the 'DNE' line before adding the new one
188 if 'DOES exist' in msg:
189 delete_from_file(cve, linenum, args.dry_run, args.verbose)
190
191 insert_into_file(cve, linenum, fixup, args.dry_run, args.verbose)
192 modified.append(cve)
193
194 elif "unknown package" in msg or "not in" in msg \
195 or "unknown release" in msg or "incorrect status"\
196 or "incorrect ignored detail" in msg:
197 pkg, rel = get_pkg_rel_from_msg(msg)
198
199 # remove this hard-coded hack one-day...
200 if rel in cve_lib.external_releases or rel == "trusty/esm":
201 cve = os.path.join(
202 cve_lib.get_external_subproject_cve_dir(rel), os.path.basename(cve)
203 )
204 linenum = identify_subproject_line_number(cve, pkg, rel)
205 if linenum == -1:
206 print(line, file=sys.stderr)
207 continue
208
209 # delete this line since
210 delete_from_file(cve, linenum, args.dry_run, args.verbose)
211
212 #if release is devel or EOL, we should add the proper status instead of removing
213 if rel == cve_lib.devel_release:
214 rel = "devel"
215 fixup = "{rel}_{pkg}: {status}\n".format(rel=rel, pkg=pkg, status="DNE")
216 insert_into_file(cve, linenum, fixup, args.dry_run, args.verbose)
217 elif not cve_lib.is_active_release(rel):
218 if 'incorrect' in msg:
219 status = msg.split("try '")[1].replace("'", "")
220 else:
221 state = msg.split(' ')[3].replace("'", "")
222 if cve_lib.is_active_esm_release(rel):
223 status = cve_lib.EOL_ESM_STATUS.format(state=state)
224 else:
225 status = cve_lib.EOL_STATUS.format(state=state)
226
227 fixup = "{rel}_{pkg}: {status}\n".format(rel=rel, pkg=pkg, status=status)
228 insert_into_file(cve, linenum, fixup, args.dry_run, args.verbose)
229
230 modified.append(cve)
231 else:
232 # print unhandled lines
233 print(line, file=sys.stderr)
diff --git a/scripts/cve_lib.py b/scripts/cve_lib.py
index 68431ea..438348a 100755
--- a/scripts/cve_lib.py
+++ b/scripts/cve_lib.py
@@ -1687,6 +1687,15 @@ def drop_dup_release(cve, rel):
1687 output.close()1687 output.close()
1688 os.rename(cve + '.new', cve)1688 os.rename(cve + '.new', cve)
16891689
1690def drop_pkg_release(cve, pkg, rel):
1691 output = codecs.open(cve + ".new", 'w', encoding="utf-8")
1692 with codecs.open(cve, encoding="utf-8") as inF:
1693 lines = inF.readlines()
1694 for line in lines:
1695 if not line.startswith('%s_%s:' % (rel, pkg)):
1696 output.write(line)
1697 output.close()
1698 os.rename(cve + '.new', cve)
16901699
1691def clone_release(cve, pkg, oldrel, newrel):1700def clone_release(cve, pkg, oldrel, newrel):
1692 output = codecs.open(cve + ".new", 'w', encoding="utf-8")1701 output = codecs.open(cve + ".new", 'w', encoding="utf-8")
@@ -1701,7 +1710,7 @@ def clone_release(cve, pkg, oldrel, newrel):
1701 os.rename(cve + '.new', cve)1710 os.rename(cve + '.new', cve)
17021711
17031712
1704def update_state(cve, pkg, rel, state, details):1713def update_state(cve, pkg, rel, state, details=None):
1705 output = codecs.open(cve + ".new", 'w', encoding="utf-8")1714 output = codecs.open(cve + ".new", 'w', encoding="utf-8")
1706 with codecs.open(cve, encoding="utf-8") as inF:1715 with codecs.open(cve, encoding="utf-8") as inF:
1707 lines = inF.readlines()1716 lines = inF.readlines()
@@ -1716,18 +1725,79 @@ def update_state(cve, pkg, rel, state, details):
1716 os.rename(cve + '.new', cve)1725 os.rename(cve + '.new', cve)
17171726
17181727
1719def add_state(cve, pkg, rel, state, details, after_rel):1728def add_state(cve, pkg, rel, state, details=None, after_rel=None):
1729 new_line = '%s_%s: %s' % (rel, pkg, state)
1730 if details:
1731 new_line += ' (%s)' % (details)
1732 new_line += '\n'
1733
1734 # This is a new file
1735 if not os.path.exists(cve):
1736 with open(cve, "w") as f:
1737 f.write(new_line)
1738 return
1739
1720 output = codecs.open(cve + ".new", 'w', encoding="utf-8")1740 output = codecs.open(cve + ".new", 'w', encoding="utf-8")
1721 with codecs.open(cve, encoding="utf-8") as inF:1741 with codecs.open(cve, encoding="utf-8") as inF:
1722 lines = inF.readlines()1742 lines = inF.readlines()
1723 for line in lines:1743
1724 if line.startswith('%s_%s:' % (after_rel, pkg)):1744 if after_rel == None:
1745 index = None
1746 if rel != 'devel':
1747 index = all_releases.index(rel)
1748 done = False
1749 found_pkg = False
1750 for line in lines:
1751 if done:
1752 output.write(line)
1753 continue
1754 if not ('_%s:' % pkg) in line:
1755 # If we're past the package section, and we wanted to add
1756 # the devel release, stick it here
1757 if rel == 'devel' and found_pkg == True:
1758 output.write(new_line)
1759 done = True
1760 output.write(line)
1761 continue
1762
1763 found_pkg = True
1764 if rel != 'devel':
1765 line_rel = line.split('_')[0]
1766 # Whoa, we hit the devel release, stick it here
1767 if line_rel == "devel":
1768 output.write(new_line)
1769 output.write(line)
1770 done = True
1771 continue
1772
1773 # Does this look like a release name?
1774 if line_rel not in all_releases:
1775 output.write(line)
1776 continue
1777
1778 # See if the release is bigger than ours, if so, stick it here
1779 if all_releases.index(line_rel) > index:
1780 output.write(new_line)
1781 output.write(line)
1782 done = True
1783 continue
1784
1785 # Nothing to see here, move along
1725 output.write(line)1786 output.write(line)
1726 line = '%s_%s: %s' % (rel, pkg, state)1787
1727 if details:1788 # If we made it here, we didn't find a place to put it, just
1728 line += ' (%s)' % (details)1789 # stick it at the end of the file
1729 line += '\n'1790 if done == False:
1730 output.write(line)1791 output.write(new_line)
1792
1793 else:
1794 for line in lines:
1795 if line.startswith('%s_%s:' % (after_rel, pkg)):
1796 output.write(line)
1797 output.write(new_line)
1798 else:
1799 output.write(line)
1800
1731 output.close()1801 output.close()
1732 os.rename(cve + '.new', cve)1802 os.rename(cve + '.new', cve)
17331803
diff --git a/scripts/test_cve_lib.py b/scripts/test_cve_lib.py
index db9b4b2..f44b4d1 100755
--- a/scripts/test_cve_lib.py
+++ b/scripts/test_cve_lib.py
@@ -7,6 +7,8 @@ import pytest
7import random7import random
8import sys8import sys
9import cve_lib9import cve_lib
10import shutil
11import filecmp
1012
11def pytest_generate_tests(metafunc):13def pytest_generate_tests(metafunc):
12 if "cvss" in metafunc.fixturenames:14 if "cvss" in metafunc.fixturenames:
@@ -28,23 +30,24 @@ def pytest_generate_tests(metafunc):
28 print("Failed to find %s to generate test cases..." % nvdjson, file=sys.stderr)30 print("Failed to find %s to generate test cases..." % nvdjson, file=sys.stderr)
29 metafunc.parametrize("cvss", [item for _, item in cvss.items()])31 metafunc.parametrize("cvss", [item for _, item in cvss.items()])
3032
31def test_cvss_empty():33class TestCVSS:
32 with pytest.raises(ValueError):34 def test_cvss_empty(self):
33 cve_lib.parse_cvss('')35 with pytest.raises(ValueError):
36 cve_lib.parse_cvss('')
3437
35def test_cvss_none():38 def test_cvss_none(self):
36 with pytest.raises(ValueError):39 with pytest.raises(ValueError):
37 cve_lib.parse_cvss(None)40 cve_lib.parse_cvss(None)
3841
39def test_cvss(cvss):42 def test_cvss(self, cvss):
40 # hack around the fact that some cvssV3 entries use the cvssV243 # hack around the fact that some cvssV3 entries use the cvssV2
41 # ADJACENT_NETWORK attackVector which is wrong...44 # ADJACENT_NETWORK attackVector which is wrong...
42 if cvss["baseMetricV3"]["cvssV3"]["attackVector"] == "ADJACENT_NETWORK":45 if cvss["baseMetricV3"]["cvssV3"]["attackVector"] == "ADJACENT_NETWORK":
43 cvss["baseMetricV3"]["cvssV3"]["attackVector"] = "ADJACENT"46 cvss["baseMetricV3"]["cvssV3"]["attackVector"] = "ADJACENT"
44 js = cve_lib.parse_cvss(cvss["baseMetricV3"]["cvssV3"]["vectorString"])47 js = cve_lib.parse_cvss(cvss["baseMetricV3"]["cvssV3"]["vectorString"])
45 # the existing impact may contain a baseMetricV2 or others so only48 # the existing impact may contain a baseMetricV2 or others so only
46 # compare CVSS349 # compare CVSS3
47 assert(js["baseMetricV3"] == cvss["baseMetricV3"])50 assert(js["baseMetricV3"] == cvss["baseMetricV3"])
4851
4952
50class TestPackageOverrideTests:53class TestPackageOverrideTests:
@@ -99,6 +102,74 @@ class TestReleaseSort:
99 assert cve_lib.release_sort(102 assert cve_lib.release_sort(
100 ["xenial", "dapper"]) == ["dapper", "xenial"]103 ["xenial", "dapper"]) == ["dapper", "xenial"]
101104
105class TestFileManipulation:
106
107 def _prepare_files(self, tmp_path, filename):
108 test_file = os.path.join(tmp_path, filename)
109 test_result = 'scripts/testfiles/' + filename + '.result'
110 shutil.copy('scripts/testfiles/' + filename + '.in', test_file)
111 return (test_file, test_result)
112
113 def test_add_state_middle(self, tmp_path):
114 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_1')
115 # Insert a release in the middle of other releases
116 cve_lib.add_state(test_file, "openssl", "mantic", "needs-triage")
117 assert filecmp.cmp(test_file, test_result)
118
119 def test_add_state_devel(self, tmp_path):
120 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_2')
121 # Insert a missing devel release
122 cve_lib.add_state(test_file, "openssl", "devel", "needs-triage")
123 assert filecmp.cmp(test_file, test_result)
124
125 def test_add_state_middle_last(self, tmp_path):
126 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_3')
127 # Insert a release in the middle of other releases in the last group
128 cve_lib.add_state(test_file, "edk2", "jammy", "needs-triage")
129 assert filecmp.cmp(test_file, test_result)
130
131 def test_add_state_devel_end_of_file(self, tmp_path):
132 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_4')
133 # Insert a missing devel release in the last group
134 cve_lib.add_state(test_file, "edk2", "devel", "needs-triage")
135 assert filecmp.cmp(test_file, test_result)
136
137 def test_add_state_with_details(self, tmp_path):
138 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_5')
139 # Insert a release in the middle of other releases with details
140 cve_lib.add_state(test_file, "openssl", "mantic", "not-affected", "code not present")
141 assert filecmp.cmp(test_file, test_result)
142
143 def test_add_state_after_rel(self, tmp_path):
144 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_6')
145 # Insert a release after a certain other release
146 cve_lib.add_state(test_file, "openssl", "mantic", "needs-triage", after_rel="jammy")
147 assert filecmp.cmp(test_file, test_result)
148
149 def test_update_state(self, tmp_path):
150 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_7')
151 # Update the state of a release
152 cve_lib.update_state(test_file, "openssl", "mantic", "not-affected")
153 assert filecmp.cmp(test_file, test_result)
154
155 def test_update_state_with_details(self, tmp_path):
156 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_8')
157 # Update the state of a release with some details
158 cve_lib.update_state(test_file, "openssl", "mantic", "not-affected", "code not present")
159 assert filecmp.cmp(test_file, test_result)
160
161 def test_clone_release(self, tmp_path):
162 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_9')
163 # Clone a release into another (ordering is weird here, what uses this?)
164 cve_lib.clone_release(test_file, "openssl", "mantic", "jammy")
165 assert filecmp.cmp(test_file, test_result)
166
167 def test_drop_pkg_release(self, tmp_path):
168 test_file, test_result = self._prepare_files(tmp_path, 'cve_lib_test_10')
169 # Drop a release
170 cve_lib.drop_pkg_release(test_file, "openssl", "mantic")
171 assert filecmp.cmp(test_file, test_result)
172
102class TestReleaseDevel:173class TestReleaseDevel:
103 def test_release_devel_direct(self):174 def test_release_devel_direct(self):
104 # ensure that there is no more than one ubuntu release marked as175 # ensure that there is no more than one ubuntu release marked as
diff --git a/scripts/testfiles/cve_lib_test.example b/scripts/testfiles/cve_lib_test.example
105new file mode 100644176new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test.example
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_1.in b/scripts/testfiles/cve_lib_test_1.in
0new file mode 10064472new file mode 100644
index 0000000..aa830d9
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_1.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32devel_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_1.result b/scripts/testfiles/cve_lib_test_1.result
0new file mode 10064471new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_1.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_10.in b/scripts/testfiles/cve_lib_test_10.in
0new file mode 10064472new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_10.in
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_10.result b/scripts/testfiles/cve_lib_test_10.result
0new file mode 10064472new file mode 100644
index 0000000..aa830d9
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_10.result
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32devel_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_2.in b/scripts/testfiles/cve_lib_test_2.in
0new file mode 10064471new file mode 100644
index 0000000..95cda1b
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_2.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_2.result b/scripts/testfiles/cve_lib_test_2.result
0new file mode 10064471new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_2.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_3.in b/scripts/testfiles/cve_lib_test_3.in
0new file mode 10064472new file mode 100644
index 0000000..d2e0b69
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_3.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_3.result b/scripts/testfiles/cve_lib_test_3.result
0new file mode 10064471new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_3.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_4.in b/scripts/testfiles/cve_lib_test_4.in
0new file mode 10064472new file mode 100644
index 0000000..b9799d0
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_4.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_4.result b/scripts/testfiles/cve_lib_test_4.result
0new file mode 10064471new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_4.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_5.in b/scripts/testfiles/cve_lib_test_5.in
0new file mode 10064472new file mode 100644
index 0000000..aa830d9
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_5.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32devel_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_5.result b/scripts/testfiles/cve_lib_test_5.result
0new file mode 10064471new file mode 100644
index 0000000..0464b30
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_5.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: not-affected (code not present)
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_6.in b/scripts/testfiles/cve_lib_test_6.in
0new file mode 10064472new file mode 100644
index 0000000..aa830d9
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_6.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32devel_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_6.result b/scripts/testfiles/cve_lib_test_6.result
0new file mode 10064471new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_6.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_7.in b/scripts/testfiles/cve_lib_test_7.in
0new file mode 10064472new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_7.in
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_7.result b/scripts/testfiles/cve_lib_test_7.result
0new file mode 10064472new file mode 100644
index 0000000..d101117
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_7.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: not-affected
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_8.in b/scripts/testfiles/cve_lib_test_8.in
0new file mode 10064472new file mode 100644
index 0000000..2dad463
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_8.in
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: needs-triage
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_8.result b/scripts/testfiles/cve_lib_test_8.result
0new file mode 10064472new file mode 100644
index 0000000..0464b30
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_8.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: needs-triage
32mantic_openssl: not-affected (code not present)
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_9.in b/scripts/testfiles/cve_lib_test_9.in
0new file mode 10064472new file mode 100644
index 0000000..babe94b
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_9.in
@@ -0,0 +1,70 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31mantic_openssl: released (1.1.2-1ubuntu6)
32devel_openssl: needs-triage
33
34Patches_openssl1.0:
35upstream_openssl1.0: needs-triage
36trusty_openssl1.0: DNE
37xenial_openssl1.0: DNE
38bionic_openssl1.0: ignored (end of standard support)
39esm-infra/bionic_openssl1.0: needs-triage
40focal_openssl1.0: DNE
41jammy_openssl1.0: DNE
42mantic_openssl1.0: DNE
43devel_openssl1.0: DNE
44
45Patches_nodejs:
46upstream_nodejs: needs-triage
47trusty_nodejs: ignored (end of standard support)
48trusty/esm_nodejs: not-affected (uses system openssl)
49xenial_nodejs: not-affected (uses system openssl)
50esm-apps/xenial_nodejs: needs-triage
51bionic_nodejs: not-affected (uses system openssl1.0)
52esm-apps/bionic_nodejs: needs-triage
53focal_nodejs: not-affected (uses system openssl)
54esm-apps/focal_nodejs: needs-triage
55jammy_nodejs: needed
56esm-apps/jammy_nodejs: needs-triage
57mantic_nodejs: not-affected (uses system openssl)
58devel_nodejs: not-affected (uses system openssl)
59
60Patches_edk2:
61upstream_edk2: needs-triage
62trusty_edk2: ignored (end of standard support)
63xenial_edk2: ignored (end of standard support)
64esm-apps/xenial_edk2: needs-triage
65bionic_edk2: ignored (end of standard support)
66esm-apps/bionic_edk2: needs-triage
67focal_edk2: needs-triage
68jammy_edk2: needs-triage
69mantic_edk2: needs-triage
70devel_edk2: needs-triage
diff --git a/scripts/testfiles/cve_lib_test_9.result b/scripts/testfiles/cve_lib_test_9.result
0new file mode 10064471new file mode 100644
index 0000000..ee6f455
--- /dev/null
+++ b/scripts/testfiles/cve_lib_test_9.result
@@ -0,0 +1,71 @@
1Candidate: CVE-2024-TEST
2PublicDate: 2024-02-16
3References:
4 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-NNN1
5Description:
6 Some flaw description
7Ubuntu-Description:
8Notes:
9Mitigation:
10Bugs:
11Priority: medium
12Discovered-by:
13Assigned-to:
14CVSS:
15
16Patches_openssl:
17upstream_openssl: needs-triage
18trusty_openssl: ignored (end of standard support)
19trusty/esm_openssl: needs-triage
20xenial_openssl: ignored (end of standard support)
21esm-infra/xenial_openssl: needs-triage
22fips-updates/xenial_openssl: needs-triage
23fips/xenial_openssl: needs-triage
24bionic_openssl: ignored (end of standard support)
25esm-infra/bionic_openssl: needs-triage
26fips-updates/bionic_openssl: needs-triage
27fips/bionic_openssl: needs-triage
28focal_openssl: needs-triage
29fips-updates/focal_openssl: needs-triage
30fips/focal_openssl: needs-triage
31jammy_openssl: released (1.1.2-1ubuntu6)
32mantic_openssl: released (1.1.2-1ubuntu6)
33devel_openssl: needs-triage
34
35Patches_openssl1.0:
36upstream_openssl1.0: needs-triage
37trusty_openssl1.0: DNE
38xenial_openssl1.0: DNE
39bionic_openssl1.0: ignored (end of standard support)
40esm-infra/bionic_openssl1.0: needs-triage
41focal_openssl1.0: DNE
42jammy_openssl1.0: DNE
43mantic_openssl1.0: DNE
44devel_openssl1.0: DNE
45
46Patches_nodejs:
47upstream_nodejs: needs-triage
48trusty_nodejs: ignored (end of standard support)
49trusty/esm_nodejs: not-affected (uses system openssl)
50xenial_nodejs: not-affected (uses system openssl)
51esm-apps/xenial_nodejs: needs-triage
52bionic_nodejs: not-affected (uses system openssl1.0)
53esm-apps/bionic_nodejs: needs-triage
54focal_nodejs: not-affected (uses system openssl)
55esm-apps/focal_nodejs: needs-triage
56jammy_nodejs: needed
57esm-apps/jammy_nodejs: needs-triage
58mantic_nodejs: not-affected (uses system openssl)
59devel_nodejs: not-affected (uses system openssl)
60
61Patches_edk2:
62upstream_edk2: needs-triage
63trusty_edk2: ignored (end of standard support)
64xenial_edk2: ignored (end of standard support)
65esm-apps/xenial_edk2: needs-triage
66bionic_edk2: ignored (end of standard support)
67esm-apps/bionic_edk2: needs-triage
68focal_edk2: needs-triage
69jammy_edk2: needs-triage
70mantic_edk2: needs-triage
71devel_edk2: needs-triage

Subscribers

People subscribed via source and target branches