go-keyring icon indicating copy to clipboard operation
go-keyring copied to clipboard

err: encoding/hex: odd length hex string

Open abatilo opened this issue 3 years ago • 3 comments

I noticed that in using the chanzuckerberg/aws-oidc project that there was a version upgrade to zalando/go-keyring v0.2.1.

It appears that in zalando/go-keyring v0.2.0, this change caused chanzuckerberg/aws-oidc to have this error.

Downgrading chanzuckerberg/aws-oidc back to zalando/go-keyring v0.1.1 fixed the problem but I don't think I understand context enough to why the accidentally breaking change was introduced in zalando/go-keyring v0.2.0

abatilo avatar Aug 11 '22 18:08 abatilo

Thanks for reporting this.

I don't have a mac so a bit hard to test as this is likely mac specific. However, I wonder if you would be able to share a token (that is expired ofc. and doesn't have secret information) which causes this, because I assume it could be somehow related to the "password" input which trigger this. We run tests on osx, so we test it a bit but likely not with input that trigger this issue: https://github.com/zalando/go-keyring/blob/2a119601fb0034fffe89c0af1f6e7be2ac16f6ab/.github/workflows/go.yml#L56

mikkeloscar avatar Aug 12 '22 08:08 mikkeloscar

I believe this error is a byproduct of the truncation seen in #84 .

I wonder if you would be able to share a token (that is expired ofc. and doesn't have secret information) which causes this

@mikkeloscar from what I can tell, most arbitrary string larger than 1996 bytes are candidates for the encoding/hex: odd length hex string error. For example the following:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

As OP indicated above, downgrading to v0.1.1 fixes this issue.

willvedd avatar Jan 04 '23 17:01 willvedd

We now merged #86 which should improve the experience here.

mikkeloscar avatar Jan 05 '23 11:01 mikkeloscar