Closed hugomrdias closed 1 year ago
When this code was written, there was no multiformat code for RSA, so we chose something in the "free range" (and I think we may have incorrectly encoded the varint back then).
This needs to be fixed, the code in ts-ucan is correct. The problem is mainly it'll break stuff :)
It’s fixed in the new server, so when we make the switch to the new UCANs we can close this one. Related to #306 (might also be rs-ucan)
Thank you @matheus23 and @icidasset for the explanation.
Is it encoding DER ANS1 RSAPublicKey
? Sizes seems to not match either
@hugomrdias I don't remember the specific name ATM. I think both the old and the new format are ASN DER, but one encodes SubjectPublicKeyInfo or something like that and the other encodes PublicKeyInfo. I think the ts-ucan code has all the details regarding the old format, too (it has awkward backwards compat code for that).
Going to close this one, when we switch to the fission-server/ucans it'll be fixed.
am i missing something here ? the magic bytes for rsa seem incorrect.
https://github.com/oddsdk/ts-odd/blob/36c5e95467e6f38044ebf18422e47442e039aad1/src/components/crypto/implementation/browser.ts#L92-L95