# internal debugging flags DBG, DBG_CRYPTO, DBG_PACKET, DBG_AUTH, DBG_PROC, DBG_PROTO, DBG_IO, DBG_SCP: con 1<Conn, nil: ref Sshio->Msg): ref AuthInfo; auth: fn(nil: ref Sshio->Conn): int; }; Sshio: module { PATH: con "sshio.dis"; Conn: adt{ in: chan of (ref Msg, string); out: chan of ref Msg; sessid: array of byte; sesskey: array of byte; hostkey: ref Keyring->PK.RSA; flags: int; cipher: Cipher; # chosen cipher user: string; host: string; interactive: int; unget: ref Msg; mk: fn(host: string, fd: ref Sys->FD): ref Conn; setkey: fn(c: self ref Conn, key: ref Keyring->PK.RSA); }; Msg: adt{ mtype: int; data: array of byte; rp: int; # read pointer wp: int; # write pointer ep: int; # byte just beyond message data mk: fn(mtype: int, length: int): ref Msg; text: fn(m: self ref Msg): string; fulltext: fn(m: self ref Msg): string; get1: fn(m: self ref Msg): int; get2: fn(m: self ref Msg): int; get4: fn(m: self ref Msg): int; getstring: fn(m: self ref Msg): string; getbytes: fn(m: self ref Msg, n: int): array of byte; getarray: fn(m: self ref Msg): array of byte; getipint: fn(m: self ref Msg): ref Keyring->IPint; getpk: fn(m: self ref Msg): ref Keyring->PK.RSA; put1: fn(m: self ref Msg, nil: int); put2: fn(m: self ref Msg, nil: int); put4: fn(m: self ref Msg, nil: int); putstring: fn(m: self ref Msg, s: string); putbytes: fn(m: self ref Msg, a: array of byte, n: int); putipint: fn(m: self ref Msg, mp: ref Keyring->IPint); putpk: fn(m: self ref Msg, pk: ref Keyring->PK.RSA); }; init: fn(); badmsg: fn(nil: ref Msg, nil: int, err: string); recvmsg: fn(nil: ref Conn, nil: int): ref Msg; unrecvmsg: fn(nil: ref Conn, nil: ref Msg); rsapad: fn(nil: ref Keyring->IPint, nil: int): ref Keyring->IPint; rsaunpad: fn(nil: ref Keyring->IPint): ref Keyring->IPint; iptorjustbe: fn(nil: ref Keyring->IPint, nil: array of byte, nil: int); rsaencryptbuf: fn(nil: ref Keyring->PK.RSA, nil: array of byte, nil: int): ref Keyring->IPint; rsagen: fn(nbits: int): ref Keyring->SK.RSA; rsaencrypt: fn(key: ref Keyring->PK.RSA, b: ref Keyring->IPint): ref Keyring->IPint; rsadecrypt: fn(key: ref Keyring->SK.RSA, b: ref Keyring->IPint): ref Keyring->IPint; debug: fn(nil: int, nil: string); error: fn(nil: string); readstrnl: fn(fd: ref Sys->FD, buf: array of byte, nbytes: int): int; calcsessid: fn(hostmod: ref Keyring->IPint, servermod: ref Keyring->IPint, cookie: array of byte): array of byte; # sshlog: fn(nil: array of byte); # TBA was ... fastrand: fn(): int; eqbytes: fn(a: array of byte, b: array of byte, n: int): int; readversion: fn(fd: ref Sys->FD): (int, int, string); hex: fn(a: array of byte): string; };