diff --git a/LICENSES/BSD-3-Clause.txt b/LICENSES/BSD-3-Clause.txt new file mode 100644 index 00000000..ea890afb --- /dev/null +++ b/LICENSES/BSD-3-Clause.txt @@ -0,0 +1,11 @@ +Copyright (c) . + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/csaf/cvss20enums.go b/csaf/cvss20enums.go index 7056f3e7..97d2e105 100644 --- a/csaf/cvss20enums.go +++ b/csaf/cvss20enums.go @@ -1,10 +1,5 @@ -// This file is Free Software under the Apache-2.0 License -// without warranty, see README.md and LICENSES/Apache-2.0.txt for details. -// -// SPDX-License-Identifier: Apache-2.0 -// -// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) -// Software-Engineering: 2023 Intevation GmbH +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2017 FIRST.ORG, INC. // // THIS FILE IS MACHINE GENERATED. EDIT WITH CARE! diff --git a/csaf/cvss3enums.go b/csaf/cvss3enums.go index b8cf54f3..32e01e3a 100644 --- a/csaf/cvss3enums.go +++ b/csaf/cvss3enums.go @@ -1,10 +1,5 @@ -// This file is Free Software under the Apache-2.0 License -// without warranty, see README.md and LICENSES/Apache-2.0.txt for details. -// -// SPDX-License-Identifier: Apache-2.0 -// -// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) -// Software-Engineering: 2023 Intevation GmbH +// SPDX-License-Identifier: BSD-3-Clause +// SPDX-FileCopyrightText: 2017 FIRST.ORG, INC. // // THIS FILE IS MACHINE GENERATED. EDIT WITH CARE! diff --git a/csaf/generate_cvss_enums.go b/csaf/generate_cvss_enums.go index 7c9b9fd6..c84ab158 100644 --- a/csaf/generate_cvss_enums.go +++ b/csaf/generate_cvss_enums.go @@ -14,21 +14,21 @@ import ( "bytes" "encoding/json" "flag" + "fmt" "go/format" "log" "os" + "regexp" "sort" "strings" "text/template" ) -const tmplText = `// This file is Free Software under the MIT License -// without warranty, see README.md and LICENSES/MIT.txt for details. -// -// SPDX-License-Identifier: MIT -// -// SPDX-FileCopyrightText: 2023 German Federal Office for Information Security (BSI) -// Software-Engineering: 2023 Intevation GmbH +// We from Intevation consider the source code parts in the following +// template file as too insignificant to be a piece of work that gains +// "copyrights" protection in the European Union. So the license(s) +// of the output files are fully determined by the input file. +const tmplText = `// {{ $.License }} // // THIS FILE IS MACHINE GENERATED. EDIT WITH CARE! @@ -69,6 +69,7 @@ type definition struct { } type schema struct { + License []string `json:"license"` Definitions map[string]*definition `json:"definitions"` } @@ -137,9 +138,22 @@ func main() { } sort.Strings(defs) + license := "determine license(s) from input file and replace this line" + + pattern := regexp.MustCompile(`Copyright \(c\) (\d+), FIRST.ORG, INC.`) + for _, line := range s.License { + if m := pattern.FindStringSubmatch(line); m != nil { + license = fmt.Sprintf( + "SPDX-License-Identifier: BSD-3-Clause\n"+ + "// SPDX-FileCopyrightText: %s FIRST.ORG, INC.", m[1]) + break + } + } + var source bytes.Buffer check(tmpl.Execute(&source, map[string]any{ + "License": license, "Prefix": *prefix, "Definitions": s.Definitions, "Keys": defs, diff --git a/csaf/schema/cvss-v2.0.json.license b/csaf/schema/cvss-v2.0.json.license new file mode 100644 index 00000000..dd033e8c --- /dev/null +++ b/csaf/schema/cvss-v2.0.json.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: BSD-3-Clause +SPDX-FileCopyrightText: 2017 FIRST.ORG, INC. diff --git a/csaf/schema/cvss-v3.0.json.license b/csaf/schema/cvss-v3.0.json.license new file mode 100644 index 00000000..dd033e8c --- /dev/null +++ b/csaf/schema/cvss-v3.0.json.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: BSD-3-Clause +SPDX-FileCopyrightText: 2017 FIRST.ORG, INC. diff --git a/csaf/schema/cvss-v3.1.json.license b/csaf/schema/cvss-v3.1.json.license new file mode 100644 index 00000000..f87ced89 --- /dev/null +++ b/csaf/schema/cvss-v3.1.json.license @@ -0,0 +1,2 @@ +SPDX-License-Identifier: BSD-3-Clause +SPDX-FileCopyrightText: 2021 FIRST.ORG, INC.