Commit fda86672 authored by owlo's avatar owlo

sweet jesus it works again

parent 21424950
File added
......@@ -31,8 +31,9 @@ func validateLogin(signature string, file []byte) bool {
decrypter := exec.Command("/bin/sh", "-c", "echo crashandburn | gpg --passphrase-fd 0 -o florpfile florp")
decrypter.Dir = "tests/"
decrypter.Run()
//defer os.Remove("tests/florp")
defer os.Remove("tests/florp")
florpFile, err := os.Open("tests/florpfile")
defer os.Remove("tests/florpfile")
florpReader := io.Reader(florpFile)
florpScanner := bufio.NewScanner(florpReader)
......@@ -51,6 +52,7 @@ func validateLogin(signature string, file []byte) bool {
}
}
return false
}
......@@ -367,7 +369,7 @@ func main() {
w.WriteHeader(http.StatusOK)
fmt.Println("Signing test json.")
signedContent := signer("tests/post.json")
fmt.Println(string(signedContent))
//fmt.Println(string(signedContent))
fmt.Println("Signing complete.")
w.Write(signedContent)
}
......@@ -397,12 +399,13 @@ func main() {
// the trailer.
fmt.Println("I HEAR BORK")
signed := req.Header.Get("Signature")
//signature, err := ioutil.ReadAll(req.Body)
// signature := req.Header.Get("Authorization")
signature, err := ioutil.ReadAll(req.Body)
fmt.Println(string(signed))
if err != nil {
fmt.Println(err)
}
ok := validateLogin(signed, []byte(signed))
ok := validateLogin(signed, []byte(signature))
if ok {
w.Header().Set("Authorization", "ok")
w.WriteHeader(http.StatusOK)
......
This diff is collapsed.
guarddoggo:bork
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment