remove socket on startup

- update deps
- remove stray log lines
This commit is contained in:
Aaron Bieber 2023-12-05 07:18:22 -07:00
parent 574414bf11
commit f4c2a3879a
No known key found for this signature in database
5 changed files with 11 additions and 12 deletions

View File

@ -131,7 +131,6 @@ func (t *Traygent) Lock(passphrase []byte) error {
}
func (t *Traygent) Unlock(unusedpassphrase []byte) error {
log.Println("unlocking agent")
if t.locked {
return errors.New("not locked")
@ -140,7 +139,6 @@ func (t *Traygent) Unlock(unusedpassphrase []byte) error {
t.mu.Lock()
defer t.mu.Unlock()
log.Println("hur")
if subtle.ConstantTimeCompare(unusedpassphrase, t.passphrase) == 1 {
t.passphrase = nil
t.locked = false
@ -199,7 +197,6 @@ func (t *Traygent) SignWithFlags(key ssh.PublicKey, data []byte, flags agent.Sig
}
func (t *Traygent) Signers() ([]ssh.Signer, error) {
log.Println("signers")
if t.locked {
return nil, errLocked

View File

@ -17,11 +17,11 @@
traygent = with pkgs;
buildGo121Module rec {
pname = "traygent";
version = "v0.1.0";
version = "v0.1.1";
src = ./.;
vendorHash =
"sha256-/Y6yj2/y9trT7Q68mC5xb7/Q2Nj51eDdTUFJAlrfqIU=";
"sha256-Fd4Yh5YHBiCt287I1iffnFtb1zGdU6st62K1ZuWXkvg=";
proxyVendor = true;
nativeBuildInputs = [ pkg-config copyDesktopItems ];

4
go.mod
View File

@ -4,7 +4,7 @@ go 1.20
require (
fyne.io/fyne/v2 v2.4.2
golang.org/x/crypto v0.15.0
golang.org/x/crypto v0.16.0
golang.org/x/image v0.14.0
)
@ -31,7 +31,7 @@ require (
github.com/yuin/goldmark v1.5.5 // indirect
golang.org/x/mobile v0.0.0-20230531173138-3c911d8e3eda // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.14.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect

10
go.sum
View File

@ -296,8 +296,8 @@ golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.15.0 h1:frVn1TEaCEaZcn3Tmd7Y2b5KKPaZ+I32Q2OA3kYp5TA=
golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@ -447,10 +447,10 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.14.0 h1:Vz7Qs629MkJkGyHxUlRHizWJRG2j8fbQKjELVSNhy7Q=
golang.org/x/sys v0.14.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.14.0 h1:LGK9IlZ8T9jvdy6cTdfKUCltatMFOehAQo9SRC46UQ8=
golang.org/x/term v0.15.0 h1:y/Oo/a/q3IXu26lQgl04j/gjuBDOBlx7X6Om1j2CPW4=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

View File

@ -26,6 +26,8 @@ func main() {
cmdList := flag.String("c", "/etc/traygent.json", "List of commands to execute")
flag.Parse()
os.Remove(*sock)
l, err := net.Listen("unix", *sock)
if err != nil {
log.Fatalln(err)