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

Add ECC Key Support #993

Merged
merged 20 commits into from
Jan 24, 2023
Merged

Add ECC Key Support #993

merged 20 commits into from
Jan 24, 2023

Conversation

directionless
Copy link
Contributor

No description provided.

Copy link
Contributor

@James-Pickett James-Pickett left a comment

Choose a reason for hiding this comment

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

general shape looks good to me, we'll shake things out after krypto merges

@directionless directionless marked this pull request as ready for review January 24, 2023 01:58
@directionless directionless changed the title Towards ECC Keys Add ECC Key Support Jan 24, 2023
Copy link
Contributor

@James-Pickett James-Pickett left a comment

Choose a reason for hiding this comment

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

looking good! left a few comments

@@ -66,6 +75,22 @@ func generateLauncherInfoTable(db *bbolt.DB) table.GenerateFunc {
},
}

// No logger, so just ignore errors. generate the pem encoding if we can.
if eccKey := agent.Keys.Public(); eccKey != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer it here if the agent package encapsulated the package level Keys var and we accessed Public() or PublicKey() via a package level func.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't decide.

I instinctively don't like the global nature of the package vars. But they feel vaguely acceptable here?

We'll need to pass them to the challenge/response thing, so I think we need the full Signer interface, not just the exposed Public(). And I wanted to expose both the hardware one, and the DB one.

I feel like correct would be to create some underlying struct to hold these free floating things that get used across a bunch of launcher. Like, we have db, which is created over in main, and then threaded through everything. I sorta imagine the keys similar. Which makes me think about threading an object (or, interface really) through a bunch of places. But then I balk at it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated to

var hardwareKeys keyInt = keys.Noop
func Keys() keyInt {
	return hardwareKeys
}

In some ways, it's the same. But in other ways, it feels a little closer to agent being an interface. So maybe?

Anyhow, happy to keep talking about it

James-Pickett
James-Pickett previously approved these changes Jan 24, 2023
RebeccaMahany
RebeccaMahany previously approved these changes Jan 24, 2023
Co-authored-by: James Pickett <James-Pickett@users.noreply.github.com>
@directionless directionless merged commit 2bd8632 into kolide:main Jan 24, 2023
@directionless directionless deleted the seph/krypto2 branch January 24, 2023 16:34
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

Successfully merging this pull request may close these issues.

3 participants