flow-go-sdk icon indicating copy to clipboard operation
flow-go-sdk copied to clipboard

Google KMS signing issue

Open turbolent opened this issue 3 years ago • 1 comments

Problem

Developers are reporting they are having trouble updating their contracts using the latest version (v0.36) of the CLI:

Invalid argument: Request field data must have length of at least 0, but not more than 65536. Provided value had length 74440.

This seems to be related to Google KMS.

They also report this is working as expected in CLI v0.34.

The Flow Go SDK was updated to a newer Google KMS SDK lately: https://github.com/onflow/flow-go-sdk/compare/v0.24.0...v0.26.2#diff-33ef32bf6c23acb95f5902d7097b7a1d5128ca061167ec0716715b0b9eeaa5f6R6)

Context

cc @prpatel05

turbolent avatar Jun 15 '22 20:06 turbolent

Did some initial digging into this. Seems like the culprit is from switching signing a digest to signing the data. Google KMS docs are a little lacking in terms of the actual limit, but I've seen them post 64KB limits for their other KMS APIs so my guess is the same limit is getting hit when signing the entire data payload.

prpatel05 avatar Jun 15 '22 21:06 prpatel05

this should already be resolved by this commit: https://github.com/onflow/flow-go-sdk/commit/447d9cf0c49ef3d78410ad83f570e2696104d064

Kay-Zee avatar Sep 15 '22 17:09 Kay-Zee

@prpatel05 @Kay-Zee I've released a new version of CLI including the latest version of Go SDK which fixes the issue. So closing this.

devbugging avatar Sep 16 '22 10:09 devbugging