Exploit databaseDownload repository ZIP
GH-8958357e96f9d8f8c98383150c404283
notkmhn/cve-2022-21449-tls-poc
Sources for CVE-2022-21449
14 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files18
notkmhn/cve-2022-21449-tls-pocRevision fa239eebae2b
- ↑..Parent directory
- gengoos.go
- goos.go
- zgoos_aix.go
- zgoos_android.go
- zgoos_darwin.go
- zgoos_dragonfly.go
- zgoos_freebsd.go
- zgoos_hurd.go
- zgoos_illumos.go
- zgoos_ios.go
- zgoos_js.go
- zgoos_linux.go
- zgoos_netbsd.go
- zgoos_openbsd.go
- zgoos_plan9.go
- zgoos_solaris.go
- zgoos_windows.go
- zgoos_zos.go
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
go/src/internal/goos/gengoos.go
Go · 1,759 bytes// Copyright 2014 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore
package main
import (
"bytes"
"fmt"
"log"
"os"
"strconv"
"strings"
)
var gooses []string
func main() {
data, err := os.ReadFile("../../go/build/syslist.go")
if err != nil {
log.Fatal(err)
}
const goosPrefix = `const goosList = `
for _, line := range strings.Split(string(data), "\n") {
if strings.HasPrefix(line, goosPrefix) {
text, err := strconv.Unquote(strings.TrimPrefix(line, goosPrefix))
if err != nil {
log.Fatalf("parsing goosList: %v", err)
}
gooses = strings.Fields(text)
}
}
for _, target := range gooses {
if target == "nacl" {
continue
}
var tags []string
if target == "linux" {
tags = append(tags, "!android") // must explicitly exclude android for linux
}
if target == "solaris" {
tags = append(tags, "!illumos") // must explicitly exclude illumos for solaris
}
if target == "darwin" {
tags = append(tags, "!ios") // must explicitly exclude ios for darwin
}
tags = append(tags, target) // must explicitly include target for bootstrapping purposes
var buf bytes.Buffer
fmt.Fprintf(&buf, "// Code generated by gengoos.go using 'go generate'. DO NOT EDIT.\n\n")
fmt.Fprintf(&buf, "//go:build %s\n", strings.Join(tags, " && "))
fmt.Fprintf(&buf, "package goos\n\n")
fmt.Fprintf(&buf, "const GOOS = `%s`\n\n", target)
for _, goos := range gooses {
value := 0
if goos == target {
value = 1
}
fmt.Fprintf(&buf, "const Is%s = %d\n", strings.Title(goos), value)
}
err := os.WriteFile("zgoos_"+target+".go", buf.Bytes(), 0666)
if err != nil {
log.Fatal(err)
}
}
}