mafintosh / webcat

Mad science p2p pipe across the web using webrtc that uses your Github private/public key for authentication and a signalhub for discovery
MIT License
445 stars 26 forks source link

TypeError: Object #<Object> has no method 'indexOf' #6

Open buildmaster opened 9 years ago

buildmaster commented 9 years ago

I've configured webcat but if I try and initiate a session with another user I get this error

/Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/index.js:24
  return key.indexOf('-----BEGIN ') > -1 ? key : sshKeyToPEM(key)
             ^
TypeError: Object #<Object> has no method 'indexOf'
    at toPEM (/Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/index.js:24:14)
    at Array.map (native)
    at signer (/Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/index.js:42:32)
    at /Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/index.js:95:20
    at identitiesAnswer (/Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/node_modules/ssh-agent/lib/ssh_agent_client.js:179:12)
    at Socket.<anonymous> (/Users/owen/.nvm/v0.10.36/lib/node_modules/webcat/node_modules/ghsign/node_modules/ssh-agent/lib/ssh_agent_client.js:279:12)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:765:14)
    at Socket.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:427:10)

The only thing about my account that might be different is I have two factor auth on, but not sure if that's meaninful or not.

mafintosh commented 9 years ago

Just published a new version that might contain a fix for this, Could you try upgrading and trying again?

buildmaster commented 9 years ago

No exception any more, but is it possible it's now just silently failing? I can't actually get it to work with another user.

buildmaster commented 9 years ago

but awesome on the quick fix for the exception :+1: to that. :)

mafintosh commented 9 years ago

If you're up for it try connecting to someone again and run it with

DEBUG=* webcat {your-friend}

and post the output in this thread. That might help us figure out whats wrong :)

buildmaster commented 9 years ago

here's my end of the output

DEBUG=* webcat mejamiewilson
  webcat new instance +0ms mejamiewilson { _: [ 'mejamiewilson' ], username: 'buildmaster' }
  webcat signing message +8ms { type: 'syn', nounce: 0.39185924432240427 }
hello
  webcat received message +29s [ 'Dp52peGxEAbeJHftOKJZtDrG5eCdi2Ou6qznklqQPBoiyEfkItTASTbBy3YsVzQ02Jhzm+PASY/cCsW5TyfxK6OPbWulyYQ074WFx5k3sYqbCtp5z6yv4vUbWsDuyaot+BnNJoGxszRr65oJgQyKAKRKU1iqpPnXxN2bBEvf4EbYd0JCuDVskj9JUlO1ypw6Bi9vZeGtp+M8UYwd+CEd+XNQqGxICEIWdtvSrLTWellDk0wFb0nBYC/fW/G+aM7SpBJvgqTEVgzBSjBICxx1ML15UfAqxKvWm7AmUpqX3scDDDSdPF2VDx7zXcpvmBz+mWNK87oqD6AYgnEU4dUSFA==',
  '{"type":"syn","nounce":0.27673072554171085}' ]
  webcat verifying message +0ms [ 'Dp52peGxEAbeJHftOKJZtDrG5eCdi2Ou6qznklqQPBoiyEfkItTASTbBy3YsVzQ02Jhzm+PASY/cCsW5TyfxK6OPbWulyYQ074WFx5k3sYqbCtp5z6yv4vUbWsDuyaot+BnNJoGxszRr65oJgQyKAKRKU1iqpPnXxN2bBEvf4EbYd0JCuDVskj9JUlO1ypw6Bi9vZeGtp+M8UYwd+CEd+XNQqGxICEIWdtvSrLTWellDk0wFb0nBYC/fW/G+aM7SpBJvgqTEVgzBSjBICxx1ML15UfAqxKvWm7AmUpqX3scDDDSdPF2VDx7zXcpvmBz+mWNK87oqD6AYgnEU4dUSFA==',
  '{"type":"syn","nounce":0.27673072554171085}' ]
  webcat message verified? +2s null true
  webcat signing message +0ms { type: 'syn', nounce: 0.39185924432240427 }
hello
hi hi hi

the messages were what I was typing into the console, seems like one connect message or something and nothing after that. @mejamiewilson was sending me a number of messages

mejamiewilson commented 9 years ago

Hi all, this is what I got:

DEBUG=* webcat buildmaster
  webcat new instance +0ms buildmaster { _: [ 'buildmaster' ], username: 'mejamiewilson' }
  webcat signing message +8ms { type: 'syn', nounce: 0.12988391635008156 }
  webcat sendSyn +15ms [ 'Bj2zmcbSEhd6yu1o62RDi/m66SE+5EiycP6XWeQTeo8HQjmZYtQtVSeLbxTWsmz+T9yhuivP/OOjaq0bVc2kvQS/FeDz1ns7U8Rr2NKzxSjRPA3J3lgrHFkR1E8tE4RSYKNVYIZ4Snv60dz+YXqKYYocna8OCYEhekFY3l2Z9YTuD8d4xyrylnTM5LDg9o6W+8dNQ/tJmuLrbRCp28cUhz0P/QouNLPZObArq++YVm6rNLS2olZhvd/QBjPGHYE0WmDkKpMny8NK7UsxLDpI17FEsFFJ93GIZwBinJmMSaADrlktp21fkucN73MFXsGa7i090Q3nx/cyrfnt1DPq3Q==',
  '{"type":"syn","nounce":0.12988391635008156}' ]
asdf
asfd