Skip to content

X.509: clean up code #6583

Description

@andybalaam

Part of X.509

Working within the X.509 prototype branch at https://github.com/matrix-org/matrix-rust-sdk/tree/andyrich/x509 , search for TODOs etc and review the code for shortcuts that are not OK for production code. Fix them or create new issues if fixes will be large.

Some ideas for cleanups:

  • Rename X509Signer -> X509Signing, X509Verifier -> X509Verifying, or better names if we can think of them. Other candidates: X509ObjectSigner, X509KeySigner, X509JsonSigner.
  • Rename X509Sign -> X509Signer RawX509Signer, X509Verify -> X509Verifier RawX509Verifier.
  • Remove X509Data. It's only used in OlmMachine.with_store. Either pass the two halves separately, or give OlmMachine a builder pattern (and pass the two halves separately into that).
  • Make X509::sign and X509Verify::verify take &[u8] arguments if possible, instead of Vec
  • Consider whether we can remove X509SignImpl in bindings/matrix-sdk-ffi/src/client_builder.rs
  • Consider whether we should split structs e.g. in crates/matrix-sdk-crypto/src/types/mod.rs into separate files
  • Clean up serialization/deserialization of X509 signatures
    • Currently we serialize X.509 signatures to a JSON object. We believe that will break existing client implementations, so we need to turn it into a single string instead.
  • ... possibly more here ...

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions