diff --git a/Cargo.toml b/Cargo.toml index 3f02b00719..bb186648cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,26 +47,26 @@ branch = "2.x" [patch.crates-io.openmls] package = "openmls" git = "https://github.com/wireapp/openmls" -#tag = "v1.0.0-pre.core-crypto-1.0.0" - branch = "feat/rfc9420" +tag = "v0.20.3-pre.core-crypto-1.0.0" +# branch = "feat/rfc9420" [patch.crates-io.openmls_traits] package = "openmls_traits" git = "https://github.com/wireapp/openmls" -#tag = "v1.0.0-pre.core-crypto-1.0.0" - branch = "feat/rfc9420" +tag = "v0.20.3-pre.core-crypto-1.0.0" +# branch = "feat/rfc9420" [patch.crates-io.openmls_basic_credential] package = "openmls_basic_credential" git = "https://github.com/wireapp/openmls" -#tag = "v1.0.0-pre.core-crypto-1.0.0" - branch = "feat/rfc9420" +tag = "v0.20.3-pre.core-crypto-1.0.0" +# branch = "feat/rfc9420" [patch.crates-io.openmls_x509_credential] package = "openmls_x509_credential" git = "https://github.com/wireapp/openmls" -#tag = "v1.0.0-pre.core-crypto-1.0.0" - branch = "feat/rfc9420" +tag = "v0.20.3-pre.core-crypto-1.0.0" +# branch = "feat/rfc9420" [patch.crates-io.hpke] git = "https://github.com/wireapp/rust-hpke.git" diff --git a/crypto/Cargo.toml b/crypto/Cargo.toml index 73ff5977ab..3c302cb1f8 100644 --- a/crypto/Cargo.toml +++ b/crypto/Cargo.toml @@ -52,6 +52,9 @@ oid-registry = "0.6" async-recursion = "1" uniffi = { workspace = true, optional = true } +# TODO: remove when coarsetime > 0.1.28 released +coarsetime = "=0.1.23" + [dependencies.proteus-wasm] version = "2.1" features = ["hazmat"] diff --git a/keystore/src/connection/platform/generic/migrations/V1__schema.sql b/keystore/src/connection/platform/generic/migrations/V1__schema.sql index 313bdb18e1..a4eabb2f79 100644 --- a/keystore/src/connection/platform/generic/migrations/V1__schema.sql +++ b/keystore/src/connection/platform/generic/migrations/V1__schema.sql @@ -1,46 +1,17 @@ -CREATE TABLE mls_credentials ( - id BLOB, - credential BLOB -); - -CREATE TABLE mls_signature_keypairs ( - signature_scheme INT, - keypair BLOB, - pk BLOB, - credential_id BLOB -); - -CREATE TABLE mls_hpke_private_keys ( - pk BLOB, - sk BLOB -); - -CREATE TABLE mls_encryption_keypairs ( - pk BLOB, - sk BLOB -); - -CREATE TABLE mls_psk_bundles ( - psk_id BLOB, - psk BLOB +CREATE TABLE mls_keys ( + id VARCHAR(255) UNIQUE, + key BLOB ); -CREATE TABLE mls_keypackages ( - keypackage_ref BLOB, - keypackage BLOB +CREATE TABLE mls_identities ( + id VARCHAR(255) UNIQUE, + signature BLOB, + credential BLOB ); CREATE TABLE mls_groups ( id BLOB, - state BLOB, - parent_id BLOB -); - -CREATE TABLE mls_pending_groups ( - id BLOB, - state BLOB, - cfg BLOB, - parent_id BLOB + state BLOB ); CREATE TABLE proteus_prekeys ( @@ -48,17 +19,8 @@ CREATE TABLE proteus_prekeys ( key BLOB ); -CREATE TABLE proteus_identities ( - pk BLOB, - sk BLOB -); - -CREATE TABLE proteus_sessions ( - id VARCHAR(255) UNIQUE, - session BLOB -); - -CREATE TABLE e2ei_enrollment ( - id VARCHAR(255) UNIQUE, - content BLOB +CREATE TABLE mls_pending_groups ( + id BLOB, + state BLOB, + cfg BLOB ); diff --git a/keystore/src/connection/platform/generic/migrations/V2__proteus.sql b/keystore/src/connection/platform/generic/migrations/V2__proteus.sql new file mode 100644 index 0000000000..22bd80524e --- /dev/null +++ b/keystore/src/connection/platform/generic/migrations/V2__proteus.sql @@ -0,0 +1,9 @@ +CREATE TABLE proteus_identities ( + sk BLOB, + pk BLOB +); + +CREATE TABLE proteus_sessions ( + id VARCHAR(255) UNIQUE, + session BLOB +); diff --git a/keystore/src/connection/platform/generic/migrations/V3__parentgroups.sql b/keystore/src/connection/platform/generic/migrations/V3__parentgroups.sql new file mode 100644 index 0000000000..b7399d99fd --- /dev/null +++ b/keystore/src/connection/platform/generic/migrations/V3__parentgroups.sql @@ -0,0 +1,2 @@ +ALTER TABLE mls_groups ADD COLUMN parent_id BLOB; +ALTER TABLE mls_pending_groups ADD COLUMN parent_id BLOB; diff --git a/keystore/src/connection/platform/generic/migrations/V4__e2ei.sql b/keystore/src/connection/platform/generic/migrations/V4__e2ei.sql new file mode 100644 index 0000000000..0bb20a54b5 --- /dev/null +++ b/keystore/src/connection/platform/generic/migrations/V4__e2ei.sql @@ -0,0 +1,4 @@ +CREATE TABLE e2ei_enrollment ( + id VARCHAR(255) UNIQUE, + content BLOB +); diff --git a/keystore/src/connection/platform/generic/migrations/V5__mls_draft_20.sql b/keystore/src/connection/platform/generic/migrations/V5__mls_draft_20.sql new file mode 100644 index 0000000000..1ef9c05d1c --- /dev/null +++ b/keystore/src/connection/platform/generic/migrations/V5__mls_draft_20.sql @@ -0,0 +1,35 @@ +-- Both those table are used only in MLS and we do not need to maintain backward compatibility there +DROP TABLE mls_keys; +DROP TABLE mls_identities; + +CREATE TABLE mls_signature_keypairs ( + signature_scheme INT, + keypair BLOB, + pk BLOB, + credential_id BLOB +); + +CREATE TABLE mls_credentials ( + id BLOB, + credential BLOB +); + +CREATE TABLE mls_hpke_private_keys ( + pk BLOB, + sk BLOB +); + +CREATE TABLE mls_encryption_keypairs ( + pk BLOB, + sk BLOB +); + +CREATE TABLE mls_psk_bundles ( + psk_id BLOB, + psk BLOB +); + +CREATE TABLE mls_keypackages ( + keypackage_ref BLOB, + keypackage BLOB +); diff --git a/keystore/src/connection/platform/generic/migrations/V2__sign_timestamp.sql b/keystore/src/connection/platform/generic/migrations/V6__sign_timestamp.sql similarity index 100% rename from keystore/src/connection/platform/generic/migrations/V2__sign_timestamp.sql rename to keystore/src/connection/platform/generic/migrations/V6__sign_timestamp.sql diff --git a/keystore/src/connection/platform/generic/migrations/V3__pending_messages.sql b/keystore/src/connection/platform/generic/migrations/V7__pending_messages.sql similarity index 100% rename from keystore/src/connection/platform/generic/migrations/V3__pending_messages.sql rename to keystore/src/connection/platform/generic/migrations/V7__pending_messages.sql diff --git a/keystore/src/connection/platform/generic/migrations/V4__epoch_encryption_keypairs.sql b/keystore/src/connection/platform/generic/migrations/V8__epoch_encryption_keypairs.sql similarity index 100% rename from keystore/src/connection/platform/generic/migrations/V4__epoch_encryption_keypairs.sql rename to keystore/src/connection/platform/generic/migrations/V8__epoch_encryption_keypairs.sql diff --git a/keystore/src/connection/platform/generic/migrations/V5__created_at_credential.sql b/keystore/src/connection/platform/generic/migrations/V9__created_at_credential.sql similarity index 100% rename from keystore/src/connection/platform/generic/migrations/V5__created_at_credential.sql rename to keystore/src/connection/platform/generic/migrations/V9__created_at_credential.sql