fission-codes / fission

Fission CLI & server
https://runfission.com/docs
119 stars 14 forks source link

Upgrade DID RSA Key format #573

Closed matheus23 closed 2 years ago

matheus23 commented 2 years ago

Ported over most changes from #550 but adapted to the format with the prefix bytes 0x85 0x24 which is the unsigned varint encoding of 0x1204. Also, instead of storing the ASN1 DER SubjectPublicKeyInfo, it stores ASN1 DER encoded RSAPublicKeys (which are part of SubjectPublicKeyInfos with RSA public keys) as per the DID spec (https://github.com/w3c-ccg/did-method-key/pull/41).

Depends on #571. Currently that's the "branch this will merge into" for better diffs on github, but I'll change this to the branch that #571 will merge into once that's merged.

matheus23 commented 2 years ago

Branch shenanigans resolved! This PR leaves the whole monorepo in compiling state, so we can merge it into main. The ucan-upgrade branch will be initiated later.

matheus23 commented 2 years ago

@expede Github Actions continues making my life hard by being somewhat flakey:

/home/runner/.stack/setup-exe-cache/x86_64-linux-nix/Cabal-simple_mPHDZzAJ_3.2.1.0_ghc-8.10.7: startProcess: exec: invalid argument (Bad file descriptor)

This only happened in the "🏺 Artifacts (Nix) / 🖥️ ubuntu-latest ❄️ Nix (pull_request)" action. All other actions are running through (including tests now!).

So I think this is ready for another round of review :+1: (no rush but just to make sure you don't think this blocked on me getting the tests working or something)

matheus23 commented 2 years ago

:joy: Thanks for the enthusiasm.

I need to change/revert one thing, which is the RSA DID encoding should be rolled back to the old format for now, because - as you've experienced - it breaks e.g. the AWAKE protocol, as long as the auth lobby doesn't understand the new DID format.

I'll merge it later today! (Let's not have another PR hanging like the last one :scream: )