eosio-java icon indicating copy to clipboard operation
eosio-java copied to clipboard

Enhance sanity check for keys returned from getRequiredKey

Open anguyenqd opened this issue 6 years ago • 0 comments

In TransactionProcessor#createSignatureRequest method, we have a sanity check whether the list of keys returned from backend by calling getRequiredKeys is a subset of provided available keys.

Check the part "Subset of keys returned in GetRequiredKeysResponse.requiredKeys ?" at EOSIO-java v 1.7.1 - createSignatureRequest workflow.pdf

The problem happens when input user's SECP256K1 public key format in available keys is not the same with SECP256K1 public key format returned from backend. Example : EOSXXXX.. vs PUB_K1_XXXX. The sanity check will fail the process and throw exception because it is using String comparison.

So far, there are 2 solutions for that:

  • Remove the sanity check.
  • Enhance the sanity check by using PEM format comparison instead of String comparison.

anguyenqd avatar May 20 '19 14:05 anguyenqd