3 Commits

Author SHA1 Message Date
idk
a13b920f05 fix mistaken identity issue with listeners 2020-09-03 21:49:16 -04:00
idk
e5d5a0360b fix godoc 2020-09-03 16:47:32 -04:00
idk
460bd1b8f4 update debian changelog 2020-09-03 16:25:27 -04:00
5 changed files with 27 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
USER_GH=eyedeekay
VERSION=0.32.25
VERSION=0.32.26
packagename=gosam
echo:

View File

@@ -24,19 +24,19 @@ func (c *Client) Listen() (net.Listener, error) {
// with Accept
func (c *Client) ListenI2P(dest string) (net.Listener, error) {
var err error
var id int32
c.id = c.NewID()
c.destination, err = c.CreateStreamSession(id, dest)
c.destination, err = c.CreateStreamSession(c.id, dest)
d := c.destination
if err != nil {
return nil, err
}
fmt.Println("destination:", c.destination)
fmt.Println("Listening on destination:", c.Base32()+".b32.i2p")
c, err = c.NewClient()
if err != nil {
return nil, err
}
c.destination = d
if c.debug {
c.SamConn = WrapConn(c.SamConn)

View File

@@ -92,16 +92,21 @@ func (c *Client) Destination() string {
// Base32 returns the base32 of the local tunnel
func (c *Client) Base32() string {
hash := sha256.New()
// hash := sha256.New()
b64, err := i2pB64enc.DecodeString(c.Base64())
if err != nil {
return ""
}
hash.Write([]byte(b64))
return strings.ToLower(strings.Replace(i2pB32enc.EncodeToString(hash.Sum(nil)), "=", "", -1))
//hash.Write([]byte(b64))
var s []byte
for _, e := range sha256.Sum256(b64) {
s = append(s, e)
}
return strings.ToLower(strings.Replace(i2pB32enc.EncodeToString(s), "=", "", -1))
}
func (c *Client) base64() []byte {
fmt.Println("\n\nDESTINATION", c.destination, "\n\n.")
if c.destination != "" {
s, _ := i2pB64enc.DecodeString(c.destination)
alen := binary.BigEndian.Uint16(s[385:387])

12
debian/changelog vendored
View File

@@ -1,3 +1,15 @@
golang-github-eyedeekay-gosam (0.32.26) UNRELEASED; urgency=medium
* Fix mistaken-identity issue with listeners
-- idk <hankhill19580@gmail.com> Thu, 03 Sept 2020 08:17:40 -0500
golang-github-eyedeekay-gosam (0.32.25) UNRELEASED; urgency=medium
* Support dual-keys by default in all future versions
-- idk <hankhill19580@gmail.com> Thu, 03 Sept 2020 04:25:04 -0500
golang-github-eyedeekay-gosam (0.32.24) UNRELEASED; urgency=medium
* Improve the mutex thingy

View File

@@ -275,7 +275,8 @@ func SetEncrypt(b bool) func(*Client) error {
}
}
//SetLeaseSetEncType tells the router to use an encrypted leaseset
//SetLeaseSetEncType tells the router to use an encrypted leaseset of a specific type.
//defaults to 4,0
func SetLeaseSetEncType(b string) func(*Client) error {
return func(c *Client) error {
c.leaseSetEncType = b