Skip to content

Conversation

@chaitanyapotti
Copy link
Member

Motivation and Context

fix issue with invalid keytype and sigtype
Jira Link:

Description

fix issue with invalid keytype and sigtype

How has this been tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist:

  • My code follows the code style of this project. (run lint)
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My code requires a db migration.

Copy link
Member

@matthiasgeihs matthiasgeihs Oct 23, 2025

Choose a reason for hiding this comment

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

The issue that is to be addressed here is unfortunately not clearly specified in the PR description.

From chat context, I assume that this is to resolve an issue where clients were sending invalid (keytype, sigtype) pairs. The change here will not help with this. The fix must be done in the client.

One thing we could change here is to improve the error messaging:
Currently we only print Invalid key type for ${sigType}, which doesn't print the keyType.
We could change the error message to include Invalid key type ${keyType} for sig type ${sigType}. (

if (sigType === SIG_TYPE.ECDSA_SECP256K1) {
if (keyType !== KEY_TYPE.SECP256K1) {
throw new Error("Invalid key type for ecdsa-secp256k1");
}
return dklsPath;
} else if (sigType === SIG_TYPE.ED25519) {
if (keyType !== KEY_TYPE.ED25519) {
throw new Error("Invalid key type for ed25519");
}
return frostPath;
} else if (sigType === SIG_TYPE.BIP340) {
if (keyType !== KEY_TYPE.SECP256K1) {
throw new Error("Invalid key type for bip340");
}
)

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