| 1 | package testsscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/ |
| 2 | |
| 3 | import ( |
| 4 | "testingscip-go gomod github.com/golang/go/src go1.15 testing/" |
| 5 | |
| 6 | "github.com/cretz/bine/torscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/" |
| 7 | ) |
| 8 | |
| 9 | func TestAuthenticateNullscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestAuthenticateNull().(t *testingscip-go gomod github.com/golang/go/src go1.15 testing/.Tscip-go gomod github.com/golang/go/src go1.15 testing/T#) { |
| 10 | ctx := NewTestContextscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/NewTestContext().(t, &torscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/.StartConfscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#{DisableCookieAuthscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#DisableCookieAuth.: true, DisableEagerAuthscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#DisableEagerAuth.: true}) |
| 11 | defer ctx.Closescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Close().() |
| 12 | // Verify auth methods before auth |
| 13 | info, err := ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..ProtocolInfoscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#ProtocolInfo().() |
| 14 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(err) |
| 15 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..ElementsMatchscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#ElementsMatch().([]string{"NULL"}, info.AuthMethodsscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/ProtocolInfo#AuthMethods.) |
| 16 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..Authenticatescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#Authenticate().("")) |
| 17 | } |
| 18 | |
| 19 | func TestAuthenticateSafeCookiescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestAuthenticateSafeCookie().(t *testingscip-go gomod github.com/golang/go/src go1.15 testing/.Tscip-go gomod github.com/golang/go/src go1.15 testing/T#) { |
| 20 | ctx := NewTestContextscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/NewTestContext().(t, &torscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/.StartConfscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#{DisableEagerAuthscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#DisableEagerAuth.: true}) |
| 21 | defer ctx.Closescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Close().() |
| 22 | // Verify auth methods before auth |
| 23 | info, err := ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..ProtocolInfoscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#ProtocolInfo().() |
| 24 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(err) |
| 25 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..ElementsMatchscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#ElementsMatch().([]string{"COOKIE", "SAFECOOKIE"}, info.AuthMethodsscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/ProtocolInfo#AuthMethods.) |
| 26 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..Authenticatescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#Authenticate().("")) |
| 27 | } |
| 28 | |
| 29 | func TestAuthenticateHashedPasswordscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestAuthenticateHashedPassword().(t *testingscip-go gomod github.com/golang/go/src go1.15 testing/.Tscip-go gomod github.com/golang/go/src go1.15 testing/T#) { |
| 30 | // "testpass" - 16:5417AE717521511A609921392778FFA8518EC089BF2162A199241AEB4A |
| 31 | ctx := NewTestContextscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/NewTestContext().(t, &torscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/.StartConfscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#{ |
| 32 | DisableCookieAuthscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#DisableCookieAuth.: true, |
| 33 | DisableEagerAuthscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#DisableEagerAuth.: true, |
| 34 | ExtraArgsscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/StartConf#ExtraArgs.: []string{"--HashedControlPassword", "16:5417AE717521511A609921392778FFA8518EC089BF2162A199241AEB4A"}, |
| 35 | }) |
| 36 | defer ctx.Closescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Close().() |
| 37 | // Verify auth methods before auth |
| 38 | info, err := ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..ProtocolInfoscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#ProtocolInfo().() |
| 39 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(err) |
| 40 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..ElementsMatchscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#ElementsMatch().([]string{"HASHEDPASSWORD"}, info.AuthMethodsscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/ProtocolInfo#AuthMethods.) |
| 41 | ctx.Requirescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tests`/TestContext#Require..NoErrorscip-go gomod github.com/stretchr/testify v1.7.0 `github.com/stretchr/testify/require`/Assertions#NoError().(ctx.Controlscip-go gomod github.com/cretz/bine . `github.com/cretz/bine/tor`/Tor#Control..Authenticatescip-go gomod github.com/cretz/bine . `github.com/cretz/bine/control`/Conn#Authenticate().("testpass")) |
| 42 | } |