-
Notifications
You must be signed in to change notification settings - Fork 6
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 enclave encrypt package and use go 1.21 #42
Conversation
cde2ffb
to
0f31ad7
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.
LGTM 🚀 - a few non-blocking comments
@@ -33,7 +33,7 @@ func Test_FromTkPrivateKey(t *testing.T) { | |||
// NIST CURVE: P-256 | |||
privateKeyFromOpenSSL := "487f361ddfd73440e707f4daa6775b376859e8a3c9f29b3bb694a12927c0213c" | |||
apiKey, err := apikey.FromTurnkeyPrivateKey(privateKeyFromOpenSSL) | |||
assert.Nil(t, err) | |||
require.NoError(t, err) |
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.
omg we've needed this so bad for e2e tests
} | ||
|
||
// Decrypt a message from the server. | ||
func (c *EnclaveEncryptClient) AuthDecrypt(payload string) (plaintext []byte, err error) { |
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.
What's the difference between Decrypt
and AuthDecrypt
? Could you update the comment to explain when one is used vs the other? They both currently show:
// Decrypt a message from the server.
) | ||
|
||
// An instance of the client side for enclave encrypt protocol. This should only be used for either | ||
// a SINGLE send or a single receive. |
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.
we could "enforce" this by setting a private boolean value when it has been "used", but that doesn't necessarily prevent misuse 🤷
enclave_encrypt
package from monorepo to be used by tk cli (Import private keys and wallets + replace toolchain with stagex tkcli#54, Export private keys and wallets tkcli#55).enclave_encrypt
package uses