()
| 1081 | } |
| 1082 | |
| 1083 | const tryNextAgentKey = () => { |
| 1084 | if (curAuth.type === 'agent') { |
| 1085 | const key = curAuth.agentCtx.nextKey(); |
| 1086 | if (key === false) { |
| 1087 | debug && debug('Agent: No more keys left to try'); |
| 1088 | debug && debug('Client: agent auth failed'); |
| 1089 | tryNextAuth(); |
| 1090 | } else { |
| 1091 | const pos = curAuth.agentCtx.pos(); |
| 1092 | let keyAlgo; |
| 1093 | curAuth.keyAlgos = getKeyAlgos(this, key, serverSigAlgs); |
| 1094 | if (curAuth.keyAlgos) { |
| 1095 | if (curAuth.keyAlgos.length) { |
| 1096 | keyAlgo = curAuth.keyAlgos[0][0]; |
| 1097 | } else { |
| 1098 | debug && debug( |
| 1099 | `Agent: Skipping key #${pos + 1} (no mutual hash algorithm)` |
| 1100 | ); |
| 1101 | tryNextAgentKey(); |
| 1102 | return; |
| 1103 | } |
| 1104 | } |
| 1105 | debug && debug(`Agent: Trying key #${pos + 1}`); |
| 1106 | proto.authPK(curAuth.username, key, keyAlgo); |
| 1107 | } |
| 1108 | } |
| 1109 | }; |
| 1110 | |
| 1111 | const startTimeout = () => { |
| 1112 | if (this.config.readyTimeout > 0) { |
nothing calls this directly
no test coverage detected