-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add ECC Key Support #993
Conversation
There was a problem hiding this 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
f8ab5d5
to
b6318ff
Compare
There was a problem hiding this 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
pkg/osquery/table/launcher_info.go
Outdated
@@ -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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Co-authored-by: James Pickett <James-Pickett@users.noreply.github.com>
No description provided.