-
Notifications
You must be signed in to change notification settings - Fork 293
feat(root): add key validation function #6064
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
base: master
Are you sure you want to change the base?
Conversation
4d2cdd7
to
026a33b
Compare
if (secret.length !== 128 && secret.length !== 192 && secret.length <= 192) { | ||
return { isValid: false, message: 'Incorrect TSS keychain' }; | ||
} | ||
} else if (multiSigType === 'onchain' && publicKey) { |
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.
if publicKey isn't provided we should be returning isValid:false for multisig no?
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.
actually we should throw an error, saying public key needs to be provided to validate multisig key
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.
if publicKey isn't provided we should be returning isValid:false for multisig no?
Actually the problem is that the encrypted prv on the key card doesn't have a public key for user/backup on multiSig Wallets. It just has BitGo's public key.
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.
ok if that's the case, we need to at least validate the private key somehow, i.e. length, format, etc... as it stands the code wont validate anything if there isnt a public key provided for multisig
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 understand though length could be tricky since private keys are probably stored encoded based on how the coin likes to encode its prv's . If we can instantiate a coin instance and that coin instance has some validate key function that would be nice
Add utility function to validate that an encrypted key can be succesfully decrypted and is a valid key.
Ticket: WP-4242
TICKET: WP-4242