mirror of https://gogs.blitter.com/RLabs/xs
Fixed syntax errors from re-org
This commit is contained in:
parent
bd261a32e9
commit
9edcc5110c
|
@ -159,7 +159,7 @@ func (h HerraduraKEx) PeerD() *big.Int {
|
|||
|
||||
// SetPeerD stores the received peer's D value (contents, not ptr)
|
||||
func (h *HerraduraKEx) SetPeerD(pd *big.Int) {
|
||||
*h.peerD = *pd
|
||||
h.peerD = new(big.Int).Set(pd)
|
||||
}
|
||||
|
||||
// ComputeFA computes the FA value, which must be sent to peer for KEx.
|
||||
|
|
|
@ -327,9 +327,9 @@ func (hl HKExListener) Accept() (hc Conn, err error) {
|
|||
hc.h.SetPeerD(d)
|
||||
log.Printf("** D:%s\n", hc.h.D().Text(16))
|
||||
log.Printf("**(s)** peerD:%s\n", hc.h.PeerD().Text(16))
|
||||
hc.h.FA()
|
||||
hc.h.ComputeFA()
|
||||
log.Printf("**(s)** FA:%s\n", hc.h.FA())
|
||||
|
||||
|
||||
// Send D and cipheropts/conn_opts to peer
|
||||
fmt.Fprintf(c, "0x%s\n%08x:%08x\n", hc.h.D().Text(16),
|
||||
hc.cipheropts, hc.opts)
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
"sync"
|
||||
|
||||
hkexsh "blitter.com/go/hkexsh"
|
||||
"blitter.com/go/hkexsh/hkexnet"
|
||||
isatty "github.com/mattn/go-isatty"
|
||||
)
|
||||
|
||||
|
@ -105,7 +106,7 @@ func main() {
|
|||
log.SetOutput(ioutil.Discard)
|
||||
}
|
||||
|
||||
conn, err := hkexsh.Dial("tcp", server, cAlg, hAlg)
|
||||
conn, err := hkexnet.Dial("tcp", server, cAlg, hAlg)
|
||||
if err != nil {
|
||||
fmt.Println("Err!")
|
||||
panic(err)
|
||||
|
@ -237,7 +238,7 @@ func main() {
|
|||
// Copy() expects EOF so this will
|
||||
// exit with outerr == nil
|
||||
//!_, outerr := io.Copy(conn, os.Stdin)
|
||||
_, outerr := func(conn *hkexsh.Conn, r io.Reader) (w int64, e error) {
|
||||
_, outerr := func(conn *hkexnet.Conn, r io.Reader) (w int64, e error) {
|
||||
return io.Copy(conn, r)
|
||||
}(conn, os.Stdin)
|
||||
|
||||
|
|
|
@ -8,11 +8,11 @@ import (
|
|||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
hkexsh "blitter.com/go/hkexsh"
|
||||
"blitter.com/go/hkexsh/hkexnet"
|
||||
)
|
||||
|
||||
// Handle pty resizes (notify server side)
|
||||
func handleTermResizes(conn *hkexsh.Conn) {
|
||||
func handleTermResizes(conn *hkexnet.Conn) {
|
||||
ch := make(chan os.Signal, 1)
|
||||
signal.Notify(ch, syscall.SIGWINCH)
|
||||
wg.Add(1)
|
||||
|
@ -28,7 +28,7 @@ func handleTermResizes(conn *hkexsh.Conn) {
|
|||
log.Println(err)
|
||||
}
|
||||
termSzPacket := fmt.Sprintf("%d %d", rows, cols)
|
||||
conn.WritePacket([]byte(termSzPacket), hkexsh.CSOTermSize)
|
||||
conn.WritePacket([]byte(termSzPacket), hkexnet.CSOTermSize)
|
||||
}
|
||||
}()
|
||||
ch <- syscall.SIGWINCH // Initial resize.
|
||||
|
|
|
@ -21,6 +21,7 @@ import (
|
|||
|
||||
"blitter.com/go/goutmp"
|
||||
hkexsh "blitter.com/go/hkexsh"
|
||||
"blitter.com/go/hkexsh/hkexnet"
|
||||
"blitter.com/go/hkexsh/spinsult"
|
||||
"github.com/kr/pty"
|
||||
)
|
||||
|
@ -80,7 +81,7 @@ func runCmdAs(who string, cmd string, conn hkex.Conn) (err error) {
|
|||
// Run a command (via default shell) as a specific user
|
||||
//
|
||||
// Uses ptys to support commands which expect a terminal.
|
||||
func runShellAs(who string, cmd string, interactive bool, conn hkexsh.Conn, chaffing bool) (err error, exitStatus int) {
|
||||
func runShellAs(who string, cmd string, interactive bool, conn hkexnet.Conn, chaffing bool) (err error, exitStatus int) {
|
||||
u, _ := user.Lookup(who)
|
||||
var uid, gid uint32
|
||||
fmt.Sscanf(u.Uid, "%d", &uid)
|
||||
|
@ -227,7 +228,7 @@ func main() {
|
|||
|
||||
// Listen on TCP port 2000 on all available unicast and
|
||||
// anycast IP addresses of the local system.
|
||||
l, err := hkexsh.Listen("tcp", laddr)
|
||||
l, err := hkexnet.Listen("tcp", laddr)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
@ -252,7 +253,7 @@ func main() {
|
|||
// Handle the connection in a new goroutine.
|
||||
// The loop then returns to accepting, so that
|
||||
// multiple connections may be served concurrently.
|
||||
go func(hc hkexsh.Conn) (e error) {
|
||||
go func(hc hkexnet.Conn) (e error) {
|
||||
defer hc.Close()
|
||||
|
||||
//We use io.ReadFull() here to guarantee we consume
|
||||
|
|
Loading…
Reference in New Issue