Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
atools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Leo
atools
Commits
2290182b
Commit
2290182b
authored
Apr 03, 2020
by
Leo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor(secfixes-check): rewrite error messages in CVE checks
parent
21e85bde
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
secfixes-check
secfixes-check
+4
-4
No files found.
secfixes-check
View file @
2290182b
...
...
@@ -193,19 +193,19 @@ local function checkCVE(str, line)
-- Check if we were given just the string 'CVE'
---
if str:len() == 0 then
violation("CVE ID
given has no year or ID
", line, "50", "SC")
violation("CVE ID
is empty
", line, "50", "SC")
end
-- CVE Identifirs are made up of only integers and hyphens after the CVE- prefix
if not str:match("^%-[%d%-]*$") then
violation("CVE ID
s
only have integers and hyphens after the initial CVE", line, "50", "SC")
violation("CVE ID only have integers and hyphens after the initial CVE", line, "50", "SC")
end
-- The value right after CVE- is the year which must always be 4 digits (YYYY)
if not str:match("^%-%d%d%d%d%-") then
violation("CVE ID
s have 4 digit year between the first and second hyphens
", line, "50", "SC")
violation("CVE ID
given does not have year in 4 digit YYYY format
", line, "50", "SC")
end
-- The last value of a CVE identifier is a collection of AT LEAST 4 digits
if not str:match("^%-.-%-%d%d%d%d+$") then
violation("CVE ID
s are at least 4 digits
", line, "50", "SC")
violation("CVE ID
given does not have at least 4 digits at the end
", line, "50", "SC")
end
local _, n = str:gsub("%-", "")
-- There must be exactly 2 hyphens, as the string is CVE-YYYY-XXXX
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment