Skip to content
New issue

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

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

Already on GitHub? # to your account

Allow tsh to connect to legacy clusters. #2784

Merged
merged 1 commit into from
Jun 24, 2019
Merged

Conversation

russjones
Copy link
Contributor

Description

While moving from lemma (NaCl based) to the new internal secret package (AES-GCM based), Teleport was updated to allow older tsh clients to connect to newer proxies. Support to allow newer tsh clients to connect to older proxies was omitted.

To allow newer tsh clients to connect to older proxies, Teleport attempts to decrypt the response payload using the new secret package, and if it fails, attempts to use the legacy lemma package.

In addition, the secret key that tsh generates is encoded in the new as well as older format when submitting the client submits the request to Teleport.

@russjones russjones requested a review from klizhentas June 19, 2019 00:16
@klizhentas klizhentas requested a review from fspmarshall June 19, 2019 00:47
lib/secret/secret.go Outdated Show resolved Hide resolved
// fails, fallback to legacy lemma package.
func (rd *Redirector) open(ciphertext []byte) ([]byte, error) {
plaintext, err := rd.key.Open(ciphertext)
if err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this do some integrity check to make sure it decodes random text, I'm pretty sure it does, but want to confirm

Copy link
Contributor Author

@russjones russjones Jun 22, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they do, AES-GCM and NaCl are both AEAD ciphers.

lib/secret/secret.go Outdated Show resolved Hide resolved
Copy link
Contributor

@klizhentas klizhentas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to have a test for the legacy stuff just in case. Also had a couple of questions

While moving from lemma (NaCl based) to the new internal secret package
(AES-GCM based), Teleport was updated to allow older tsh clients to
connect to newer proxies. Support to allow newer tsh clients to connect
to older proxies was omitted.

To allow newer tsh clients to connect to older proxies, Teleport
attempts to decrypt the response payload using the new secret
package, and if it fails, attempts to use the legacy lemma package.

In addition, the secret key that tsh generates is encoded in the new as
well as older format when submitting the client submits the request to
Teleport.
@russjones russjones merged commit 7c73a90 into branch/4.0 Jun 24, 2019
@russjones russjones deleted the rjones/tsh-lemma branch June 24, 2019 18:34
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants