Skip to content

Commit

Permalink
more osv-schema adaptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed May 1, 2023
1 parent bbe3944 commit d8239b7
Showing 1 changed file with 25 additions and 6 deletions.
31 changes: 25 additions & 6 deletions docs/vuln2json.pl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ sub scancve {
" \"CWE\": \"$cwe\",\n".
" \"published\": \"$announce\",\n".
" \"affected\": [ {\n".
" \"package\": {\n".
" \"name\": \"curl\"\n".
" }\n".
" \"package\": {\n".
" \"name\": \"curl\"\n".
" }\n".
" \"ranges\": [\n".
" {\n".
" \"type\": \"SEMVER\",\n".
Expand All @@ -107,9 +107,28 @@ sub scancve {
" }\n".
" ]\n".
" } ],\n";
print " \"severity\": \"$severity\",\n" if($severity);
print " \"reporter\": \"$repby\",\n" if($reporter);
print " \"patcher\": \"$patchby\",\n" if($patchby);
if($severity) {
print " \"severity\": [ {\n".
" \"type\": \"basic\",\n".
" \"score\": \"$severity\"\n".
" } ],\n";
}
print " \"credits\": [\n";
if($repby) {
print " {\n".
" \"name\": \"$repby\"\n".
" \"type\": \"FINDER\"\n".
" }";
print "," if($patchby);
print "\n";
}
if($patchby) {
print " {\n".
" \"name\": \"$patchby\"\n".
" \"type\": \"REMEDIATION_DEVELOPER\"\n".
" }\n";
}
print " ],\n";
printf " \"details\": \"%s\"\n".
" }", jsonquote($desc);
$i++;
Expand Down

0 comments on commit d8239b7

Please sign in to comment.