Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

serialised private keys with forward slash fails parsing #85

Closed
hugomrdias opened this issue Aug 25, 2022 · 2 comments
Closed

serialised private keys with forward slash fails parsing #85

hugomrdias opened this issue Aug 25, 2022 · 2 comments
Assignees

Comments

@hugomrdias
Copy link
Contributor

SigningAuthority.parse fails with private keys with forward slash in ipld/car with unexpected end of data

// ../../node_modules/.pnpm/@ipld+car@4.1.4/node_modules/@ipld/car/esm/lib/decoder.js
  var CIDV0_BYTES = {
    SHA2_256: 18,
    LENGTH: 32,
    DAG_PB: 112
  };
  var V2_HEADER_LENGTH = 16 + 8 + 8 + 8;
  async function readVarint(reader) {
    const bytes = await reader.upTo(8);
    if (!bytes.length) {
      throw new Error("Unexpected end of data");
    }
    const i = import_varint3.default.decode(bytes);
    reader.seek(import_varint3.default.decode.bytes);
    return i;
  }
@Gozala
Copy link
Collaborator

Gozala commented Sep 6, 2022

Do you have an example or something, I'm not sure I fully understand what the problem is

@hugomrdias
Copy link
Contributor Author

MgCYY9lYduqC9rrtD1YvZzcEfPCFBaYsTe0T+8RLLBawPWu0BAaNqeI86jQPsOeSaZ7p+ZPWGFqggfvSMFw+AJ7BH8/U= this private key string would fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants