@@ -114,6 +114,10 @@ def create_agent_parser(device_type):
114
114
115
115
p .add_argument ('identity' , type = _to_unicode , default = None ,
116
116
help = 'proto://[user@]host[:port][/path]' )
117
+
118
+ p .add_argument ('-i' , '--additional_identities' , type = _to_unicode , default = [], action = 'append' ,
119
+ help = 'proto://[user@]host[:port][/path]' )
120
+
117
121
p .add_argument ('command' , type = str , nargs = '*' , metavar = 'ARGUMENT' ,
118
122
help = 'command to run under the SSH agent' )
119
123
return p
@@ -250,12 +254,19 @@ def _get_sock_path(args):
250
254
return sock_path
251
255
252
256
257
+ def _add_additional_identities (identities , additional_identities , ecdsa_curve_name ):
258
+ for identity in additional_identities :
259
+ identities .append (device .interface .Identity (
260
+ identity_str = identity , curve_name = ecdsa_curve_name ))
261
+
262
+
253
263
@handle_connection_error
254
264
def main (device_type ):
255
265
"""Run ssh-agent using given hardware client factory."""
256
266
args = create_agent_parser (device_type = device_type ).parse_args ()
257
267
util .setup_logging (verbosity = args .verbose , filename = args .log_file )
258
268
269
+ identities = []
259
270
public_keys = None
260
271
filename = None
261
272
if args .identity .startswith ('/' ):
@@ -268,6 +279,9 @@ def main(device_type):
268
279
else :
269
280
identities = [device .interface .Identity (
270
281
identity_str = args .identity , curve_name = args .ecdsa_curve_name )]
282
+
283
+ _add_additional_identities (identities , args .additional_identities , args .ecdsa_curve_name )
284
+
271
285
for index , identity in enumerate (identities ):
272
286
identity .identity_dict ['proto' ] = 'ssh'
273
287
log .info ('identity #%d: %s' , index , identity .to_string ())
0 commit comments