Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending keys with particle keys doctor does not respect protocol #582

Open
jlkalberer opened this issue May 12, 2020 · 0 comments
Open

Sending keys with particle keys doctor does not respect protocol #582

jlkalberer opened this issue May 12, 2020 · 0 comments

Comments

@jlkalberer
Copy link

Description

When setting up a device you can pass the --protocol tcp flag to use TCP instead of UDP. This will cause the device to send RSA keys instead of ECC keys when connecting. When I call particle keys doctor it does not check what protocol the device is using. For an Electron, it always defaults to sending an ECC key.

Steps to reproduce

particle keys server default_key.pub.pem --host IP_ADDRESS --protocol tcp
particle keys doctor XXXXXXXXXXXXX

The server sees:

{ deviceID: 'XXXXXXXXXXXXX',
  publicKey:
   '-----BEGIN PUBLIC KEY-----\r\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEQEq9vQ/4R01YpBjamex0slA/az72\r\nY08ngBh8BlE17S9g7GrHwQnsEjyUuBTjfjcY0P/isrBimw0gh3qiai6mRA==\r\n-----END PUBLIC KEY-----\r\n',
  order: 'manual_1589295982289',
  filename: 'cli',
  algorithm: 'ecc' }

Expected result

Since the device is in DFU mode, the CLI should first query what protocol the device is using (particle keys protocol) and use that instead of defaulting to a specific value.

Actual result

Once the device tries to connect, it sends an RSA key but the server has stored the ECC key. The device won't connect.

Environment

  • OS: All
  • Node (run node -v): v10.13.0
  • NPM (run npm -v): Yarn 1.21.1
  • Particle CLI (run particle version): 1.49.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant