Merge branch 'asaur' of dan/libricochet-go into master
This commit is contained in:
commit
1056fce116
|
@ -12,7 +12,7 @@ import (
|
|||
// "127.0.0.1:9051" "tcp4"
|
||||
// "/var/run/tor/control" "unix"
|
||||
func SetupOnion(torControlAddress string, torControlSocketType string, authentication string, pk *rsa.PrivateKey, onionport uint16) (net.Listener, error) {
|
||||
c, err := bulb.Dial(torControlSocketType, torControlAddress)
|
||||
c, err := asaur.Dial(torControlSocketType, torControlAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ func SetupOnion(torControlAddress string, torControlSocketType string, authentic
|
|||
return nil, err
|
||||
}
|
||||
|
||||
cfg := &bulb.NewOnionConfig{
|
||||
cfg := &asaur.NewOnionConfig{
|
||||
DiscardPK: true,
|
||||
PrivateKey: pk,
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ func SetupOnion(torControlAddress string, torControlSocketType string, authentic
|
|||
}
|
||||
|
||||
func SetupOnionV3(torControlAddress string, torControlSocketType string, authentication string, pk ed25519.PrivateKey, onionstr string, onionport uint16) (net.Listener, error) {
|
||||
c, err := bulb.Dial(torControlSocketType, torControlAddress)
|
||||
c, err := asaur.Dial(torControlSocketType, torControlAddress)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -48,12 +48,12 @@ func SetupOnionV3(torControlAddress string, torControlSocketType string, authent
|
|||
copy(privkey[0:32], digest[:32])
|
||||
copy(privkey[32:64], digest[32:])
|
||||
|
||||
onionPK := &bulb.OnionPrivateKey{
|
||||
onionPK := &asaur.OnionPrivateKey{
|
||||
KeyType: "ED25519-V3",
|
||||
Key: base64.StdEncoding.EncodeToString(privkey[0:64]),
|
||||
}
|
||||
|
||||
cfg := &bulb.NewOnionConfig{
|
||||
cfg := &asaur.NewOnionConfig{
|
||||
Onion: onionstr,
|
||||
DiscardPK: true,
|
||||
PrivateKey: onionPK,
|
||||
|
|
|
@ -55,7 +55,7 @@ func (nr *NetworkResolver) Resolve(hostname string) (net.Conn, string, error) {
|
|||
|
||||
conn, err := torDialer.Dial("tcp", resolvedHostname+".onion:9878")
|
||||
if err != nil {
|
||||
torc, err := bulb.Dial("tcp4", "127.0.0.1:9051")
|
||||
torc, err := asaur.Dial("tcp4", "127.0.0.1:9051")
|
||||
if err != nil {
|
||||
log.Printf("%v\n", err)
|
||||
return nil, "", err
|
||||
|
@ -74,8 +74,9 @@ func (nr *NetworkResolver) Resolve(hostname string) (net.Conn, string, error) {
|
|||
}
|
||||
|
||||
// runs SIGNAL NEWNYM on the tor control port to flush the onion descriptors cache
|
||||
func NewNym(c *bulb.Conn) error {
|
||||
func NewNym(c *asaur.Conn) error {
|
||||
_, err := c.Request("SIGNAL NEWNYM")
|
||||
|
||||
if err != nil {
|
||||
c.Close()
|
||||
}
|
||||
|
|
Reference in New Issue