@@ -13,28 +13,29 @@ import (
13
13
14
14
"gopkg.in/alecthomas/kingpin.v2"
15
15
16
+ scionlog "github.com/scionproto/scion/go/lib/log"
16
17
"github.com/scionproto/scion/go/lib/snet"
18
+ "github.com/scionproto/scion/go/lib/snet/squic"
17
19
20
+ "github.com/netsec-ethz/scion-apps/lib/scionutil"
18
21
"github.com/netsec-ethz/scion-apps/ssh/client/clientconfig"
19
22
"github.com/netsec-ethz/scion-apps/ssh/client/ssh"
20
23
"github.com/netsec-ethz/scion-apps/ssh/config"
21
- "github.com/netsec-ethz/scion-apps/ssh/scionutils"
22
24
"github.com/netsec-ethz/scion-apps/ssh/utils"
23
25
24
26
log "github.com/inconshreveable/log15"
25
27
)
26
28
27
29
var (
28
30
// Connection
29
- SERVER_ADDRESS = kingpin .Arg ("host-address" , "Server SCION address (without the port)" ).Required ().String ()
30
- RUN_COMMAND = kingpin .Arg ("command" , "Command to run (empty for pty)" ).Strings ()
31
- PORT = kingpin .Flag ("port" , "The server's port" ).Default ("0" ).Short ('p' ).Uint16 ()
32
- USE_IA_SCIOND_PATH = kingpin .Flag ("sciond-path-from-ia" , "Use IA when resolving SCIOND socket path" ).Bool ()
33
- LOCAL_FORWARD = kingpin .Flag ("local-forward" , "Forward remote address connections to listening port. Format: listening_port:remote_address" ).Short ('L' ).String ()
34
- OPTIONS = kingpin .Flag ("option" , "Set an option" ).Short ('o' ).Strings ()
35
- VERBOSE = kingpin .Flag ("verbose" , "Be verbose" ).Short ('v' ).Default ("false" ).Bool ()
36
- CONFIG_FILES = kingpin .Flag ("config" , "Configuration files" ).Short ('c' ).Default ("/etc/ssh/ssh_config" , "~/.ssh/config" ).Strings ()
37
- X_DEAD = kingpin .Flag ("x-dead" , "Placeholder for SCP support" ).Short ('x' ).Default ("false" ).Bool ()
31
+ SERVER_ADDRESS = kingpin .Arg ("host-address" , "Server SCION address (without the port)" ).Required ().String ()
32
+ RUN_COMMAND = kingpin .Arg ("command" , "Command to run (empty for pty)" ).Strings ()
33
+ PORT = kingpin .Flag ("port" , "The server's port" ).Default ("0" ).Short ('p' ).Uint16 ()
34
+ LOCAL_FORWARD = kingpin .Flag ("local-forward" , "Forward remote address connections to listening port. Format: listening_port:remote_address" ).Short ('L' ).String ()
35
+ OPTIONS = kingpin .Flag ("option" , "Set an option" ).Short ('o' ).Strings ()
36
+ VERBOSE = kingpin .Flag ("verbose" , "Be verbose" ).Short ('v' ).Default ("false" ).Bool ()
37
+ CONFIG_FILES = kingpin .Flag ("config" , "Configuration files" ).Short ('c' ).Default ("/etc/ssh/ssh_config" , "~/.ssh/config" ).Strings ()
38
+ X_DEAD = kingpin .Flag ("x-dead" , "Placeholder for SCP support" ).Short ('x' ).Default ("false" ).Bool ()
38
39
39
40
// TODO: additional file paths
40
41
KNOWN_HOSTS_FILE = kingpin .Flag ("known-hosts" , "File where known hosts are stored" ).ExistingFile ()
@@ -110,6 +111,7 @@ func updateConfigFromFile(conf *clientconfig.ClientConfig, pth string) {
110
111
111
112
func main () {
112
113
kingpin .Parse ()
114
+ scionlog .SetupLogConsole ("debug" )
113
115
114
116
conf := createConfig ()
115
117
@@ -124,10 +126,19 @@ func main() {
124
126
}
125
127
knownHostsFile = utils .ParsePath (knownHostsFile )
126
128
127
- // Initialize SCION library
128
- err = scionutils .InitSCIONConnection (utils .ParsePath (conf .QUICKeyPath ), utils .ParsePath (conf .QUICCertificatePath ), * USE_IA_SCIOND_PATH )
129
+ localhost , err := scionutil .GetLocalhost ()
129
130
if err != nil {
130
- golog .Panicf ("Error initializing SCION connection: %s" , err )
131
+ golog .Panicf ("Can't get localhost: %v" , err )
132
+ }
133
+
134
+ err = scionutil .InitSCION (localhost )
135
+ if err != nil {
136
+ golog .Panicf ("Error initializing SCION: %v" , err )
137
+ }
138
+
139
+ err = squic .Init (utils .ParsePath (conf .QUICKeyPath ), utils .ParsePath (conf .QUICCertificatePath ))
140
+ if err != nil {
141
+ golog .Panicf ("Error initializing SQUIC: %v" , err )
131
142
}
132
143
133
144
verifyNewKeyHandler := PromptAcceptHostKey
0 commit comments