(CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:tid) op: Equal rhs: {(DQ ('pkcs11 agent test'))} spids: [7] ) ] spids: [7] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:TEST_SSH_PIN) op:Equal rhs:{(DQ )} spids:[13])] spids: [13] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:TEST_SSH_PKCS11) op: Equal rhs: {(/usr/local/lib/soft-pkcs11.so.0.0)} spids: [17] ) ] spids: [17] ) (AndOr children: [ (C {(test)} {(-f)} {(DQ ($ VSub_Name '$TEST_SSH_PKCS11'))}) (C {(fatal)} {(DQ ($ VSub_Name '$TEST_SSH_PKCS11') (' does not exist'))}) ] op_id: Op_DPipe ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:SOFTPKCS11RC) op: Equal rhs: {($ VSub_Name '$OBJ') (/pkcs11.info)} spids: [42] ) ] spids: [42] ) (C {(export)} {(SOFTPKCS11RC)}) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:SSH_ASKPASS) op:Equal rhs:{(/usr/bin/true)} spids:[53])] spids: [53] ) (C {(export)} {(SSH_ASKPASS)}) (C {(unset)} {(DISPLAY)}) (FuncDef name: notty body: (BraceGroup children: [ (C {(perl)} {(-e)} { (SQ <'use POSIX; POSIX::setsid(); \n'> <'\t if (fork) { wait; exit($? >> 8); } else { exec(@ARGV) }'> ) } {(DQ ($ VSub_At '$@'))} ) ] spids: [72] ) spids: [68 71] ) (C {(trace)} {(DQ ('start agent'))}) (SimpleCommand words: [ {(eval)} { (CommandSubPart command_list: (CommandList children:[(C {(${ VSub_Name SSHAGENT)} {(-s)})]) left_token: <Left_Backtick '`'> spids: [99 105] ) } ] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[107])] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[111])] spids: [111] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(fail)} {(DQ ('could not start ssh-agent: exit code ') ($ VSub_Name '$r'))})] spids: [16777215 127] ) ] else_action: [ (C {(trace)} {(DQ ('generating key/cert'))}) (C {(rm)} {(-f)} {($ VSub_Name '$OBJ') (/pkcs11.key)} {($ VSub_Name '$OBJ') (/pkcs11.crt)}) (SimpleCommand words: [{(openssl)} {(genrsa)} {(-out)} {($ VSub_Name '$OBJ') (/pkcs11.key)} {(2048)}] redirects: [ (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[169]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[173]) ] ) (C {(chmod)} {(600)} {($ VSub_Name '$OBJ') (/pkcs11.key)}) (SimpleCommand words: [ {(openssl)} {(req)} {(-key)} {($ VSub_Name '$OBJ') (/pkcs11.key)} {(-new)} {(-x509)} {(-out)} {($ VSub_Name '$OBJ') (/pkcs11.crt)} {(-text)} {(-subj)} {(SQ <'/CN=pkcs11 test'>)} ] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[214])] ) (SimpleCommand words: [ {(printf)} { (DQ (a) (Lit_Other '\\') (ta) (Lit_Other '\\') (t) ($ VSub_Name '$OBJ') (/pkcs11.crt) (Lit_Other '\\') (t) ($ VSub_Name '$OBJ') (/pkcs11.key) ) } ] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {($ VSub_Name '$SOFTPKCS11RC')} spids: [235] ) ] ) (SimpleCommand words: [{(${ VSub_Name SSHKEYGEN)} {(-y)} {(-f)} {($ VSub_Name '$OBJ') (/pkcs11.key)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {($ VSub_Name '$OBJ') (/authorized_keys_) ($ VSub_Name '$USER')} spids: [255] ) ] ) (C {(trace)} {(DQ ('add pkcs11 key to agent'))}) (Pipeline children: [ (C {(echo)} {(${ VSub_Name TEST_SSH_PIN)}) (SimpleCommand words: [{(notty)} {(${ VSub_Name SSHADD)} {(-s)} {(${ VSub_Name TEST_SSH_PKCS11)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [290] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[294]) ] ) ] negated: False ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[298])] spids: [298] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(fail)} {(DQ ('ssh-add -s failed: exit code ') ($ VSub_Name '$r'))})] spids: [16777215 315] ) ] spids: [16777215 326] ) (C {(trace)} {(DQ ('pkcs11 list via agent'))}) (SimpleCommand words: [{(${ VSub_Name SSHADD)} {(-l)}] redirects: [ (Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[343]) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[347]) ] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[351])] spids: [351] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(fail)} {(DQ ('ssh-add -l failed: exit code ') ($ VSub_Name '$r'))})] spids: [16777215 368] ) ] spids: [16777215 379] ) (C {(trace)} {(DQ ('pkcs11 connect via agent'))}) (C {(${ VSub_Name SSH)} {(-2)} {(-F)} {($ VSub_Name '$OBJ') (/ssh_proxy)} {(somehost)} {(exit)} {(5)} ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[408])] spids: [408] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(5)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(fail)} {(DQ ('ssh connect failed (exit code ') ($ VSub_Name '$r') (')'))})] spids: [16777215 425] ) ] spids: [16777215 437] ) (C {(trace)} {(DQ ('remove pkcs11 keys'))}) (Pipeline children: [ (C {(echo)} {(${ VSub_Name TEST_SSH_PIN)}) (SimpleCommand words: [{(notty)} {(${ VSub_Name SSHADD)} {(-e)} {(${ VSub_Name TEST_SSH_PKCS11)}] redirects: [ (Redir op_id: Redir_Great fd: 16777215 arg_word: {(/dev/null)} spids: [468] ) (Redir op_id:Redir_GreatAnd fd:2 arg_word:{(1)} spids:[472]) ] ) ] negated: False ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:r) op:Equal rhs:{($ VSub_QMark '$?')} spids:[476])] spids: [476] ) (If arms: [ (if_arm cond: [ (Sentence child: (C {(Lit_Other '[')} {($ VSub_Name '$r')} {(-ne)} {(0)} {(Lit_Other ']')}) terminator: <Op_Semi ';'> ) ] action: [(C {(fail)} {(DQ ('ssh-add -e failed: exit code ') ($ VSub_Name '$r'))})] spids: [16777215 493] ) ] spids: [16777215 504] ) (C {(trace)} {(DQ ('kill agent'))}) (SimpleCommand words: [{(${ VSub_Name SSHAGENT)} {(-k)}] redirects: [(Redir op_id:Redir_Great fd:16777215 arg_word:{(/dev/null)} spids:[521])] ) ] spids: [137 525] ) ] )