Commit 940d983a authored by Localtoast's avatar Localtoast 💬

cleanup

parent 7af760e1
.Ogopogo
File deleted
......@@ -17,8 +17,6 @@ import (
"time"
flour "gitlab.com/localtoast/flourPower"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"gitlab.com/owlo/Ogopogo/libs"
)
......@@ -178,78 +176,6 @@ func validate(signature string, file []byte) bool {
}
return true
}
func signer(path string) []byte {
const prefix = "/home/twotonne/"
const secretKeyring = prefix + "go/src/localtoast.net/localtoast/skey"
const publicKeyring = prefix + "go/src/localtoast.net/localtoast/keys"
const superSecretKeys = prefix + "go/src/localtoast.net/localtoast/sskey"
secRingBuf, err := os.Open(secretKeyring)
defer secRingBuf.Close()
pubRingBuf, err := os.Open(publicKeyring)
defer pubRingBuf.Close()
sskeyRingBuf, err := os.Open(superSecretKeys)
defer sskeyRingBuf.Close()
if err != nil {
fmt.Println("Error grabbing public/private keyring, have you generated keys yet?")
}
entitiesPrivate, err := openpgp.ReadArmoredKeyRing(secRingBuf)
entities, err := openpgp.ReadArmoredKeyRing(pubRingBuf)
sskey, err := openpgp.ReadArmoredKeyRing(sskeyRingBuf)
for i := range entities {
entitiesPrivate = append(entitiesPrivate, entities[i])
}
for i := range sskey {
entitiesPrivate = append(entitiesPrivate, sskey[i])
}
fmt.Println(entitiesPrivate)
buff, err := os.Create("tests/Buff")
defer buff.Close()
if err != nil {
fmt.Println("Error creating buffer file.")
}
data, err := os.Open(path)
defer data.Close()
err = entitiesPrivate[1].PrivateKey.Decrypt([]byte("crashandburn"))
if err != nil {
fmt.Println("Error decrypting signing key.")
}
bytebuf, err := os.Create("tests/BuffArmored")
//bytebuf := bytes.NewBuffer(nil)
//defer bytebuf.Close()
dataArmor, err := armor.Encode(bytebuf, "PGP SIGNATURE", nil)
message, err := openpgp.Encrypt(dataArmor, entitiesPrivate, entitiesPrivate[1], nil, nil)
defer message.Close()
//err = openpgp.ArmoredDetachSign(buff, entitiesPrivate[1], data, nil)
if err != nil {
fmt.Println("Error creating encrypted file.")
fmt.Println(err)
}
//ciphertext, err := encrypt(data, []byte("CRYPTOGRAPHYFUCK"))
dataRead, err := ioutil.ReadFile(path)
_, err = message.Write(dataRead)
//encryptedFile, err := os.Create("tests/BuffArmor")
//encryptedReader := io.Writer(encryptedFile)
//defer encryptedFile.Close()
//encrypted := make([]byte)
//_, err = message.Write(encryptedReader)
if err != nil {
fmt.Println("Error reading signed text.")
fmt.Println(err)
}
if err == nil {
message.Close()
dataArmor.Close()
}
returnable, err := ioutil.ReadFile("tests/BuffArmored")
if err != nil {
fmt.Println("Error reading buffarmor")
}
return returnable
}
func runHackTrace(user string, target string, initializedActors []libs.ActorS) string {
......@@ -952,7 +878,7 @@ func main() {
validate(UID, object)
})
const prefix = "/home/twotonne/"
prefix := os.Getenv("GOPATH")
mux.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
w.Header().Add("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
......@@ -975,8 +901,7 @@ func main() {
TLSConfig: cfg,
TLSNextProto: make(map[string]func(*http.Server, *tls.Conn, http.Handler), 0),
}
log.Fatal(srv.ListenAndServeTLS(prefix+"go/src/localtoast.net/localtoast/server.rsa.crt", prefix+"go/src/localtoast.net/localtoast/server.rsa.key"))
log.Fatal(srv.ListenAndServeTLS(prefix+"/gitlab.com/owlo/server.rsa.crt", prefix+"/gitlab.com/owlo/server.rsa.key"))
// http.ListenAndServeTLS(":443", prefix+"go/src/localtoast.net/localtoast/server.rsa.crt", prefix+"go/src/localtoast.net/localtoast/server.rsa.key", mux)
}
}
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