Skip to content

Commit 001e5bf

Browse files
author
github-actions
committed
Bump CRYPTO version to 26.1.28 (matrix-rust-sdk to 1fb2ca58433096178a1a438d052615ec568549f2)
1 parent 6f89f48 commit 001e5bf

File tree

4 files changed

+41
-23
lines changed

4 files changed

+41
-23
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
object BuildVersionsCrypto {
22
const val majorVersion = 26
33
const val minorVersion = 1
4-
const val patchVersion = 23
4+
const val patchVersion = 28
55
}

crypto/crypto-android/src/main/kotlin/org/matrix/rustcomponents/sdk/crypto/matrix_sdk_crypto_ffi.kt

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,13 @@ import uniffi.matrix_sdk_crypto.DecryptionSettings
3838
import uniffi.matrix_sdk_crypto.FfiConverterTypeCollectStrategy
3939
import uniffi.matrix_sdk_crypto.FfiConverterTypeDecryptionSettings
4040
import uniffi.matrix_sdk_crypto.FfiConverterTypeLocalTrust
41-
import uniffi.matrix_sdk_crypto.FfiConverterTypeSecretsBundle
4241
import uniffi.matrix_sdk_crypto.FfiConverterTypeSignatureState
4342
import uniffi.matrix_sdk_crypto.LocalTrust
44-
import uniffi.matrix_sdk_crypto.SecretsBundle
4543
import uniffi.matrix_sdk_crypto.SignatureState
4644
import uniffi.matrix_sdk_common.RustBuffer as RustBufferShieldStateCode
4745
import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferCollectStrategy
4846
import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferDecryptionSettings
4947
import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferLocalTrust
50-
import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferSecretsBundle
5148
import uniffi.matrix_sdk_crypto.RustBuffer as RustBufferSignatureState
5249

5350
// This is a helper for safely working with byte buffers returned from the Rust code.
@@ -99,7 +96,7 @@ open class RustBuffer : Structure() {
9996

10097
@Suppress("TooGenericExceptionThrown")
10198
fun asByteBuffer() =
102-
this.data?.getByteBuffer(0, this.len.toLong())?.also {
99+
this.data?.getByteBuffer(0, this.len)?.also {
103100
it.order(ByteOrder.BIG_ENDIAN)
104101
}
105102
}
@@ -1166,7 +1163,7 @@ external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_cross_sign
11661163
external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_room_keys(`ptr`: Long,`passphrase`: RustBuffer.ByValue,`rounds`: Int,uniffi_out_err: UniffiRustCallStatus,
11671164
): RustBuffer.ByValue
11681165
external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_secrets_bundle(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
1169-
): Long
1166+
): RustBuffer.ByValue
11701167
external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_get_backup_keys(`ptr`: Long,uniffi_out_err: UniffiRustCallStatus,
11711168
): RustBuffer.ByValue
11721169
external fun uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_get_device(`ptr`: Long,`userId`: RustBuffer.ByValue,`deviceId`: RustBuffer.ByValue,`timeout`: Int,uniffi_out_err: UniffiRustCallStatus,
@@ -1613,7 +1610,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
16131610
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_room_keys() != 48778.toShort()) {
16141611
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
16151612
}
1616-
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_secrets_bundle() != 55212.toShort()) {
1613+
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_export_secrets_bundle() != 61345.toShort()) {
16171614
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
16181615
}
16191616
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_olmmachine_get_backup_keys() != 30940.toShort()) {
@@ -1817,7 +1814,7 @@ private fun uniffiCheckApiChecksums(lib: IntegrityCheckingUniffiLib) {
18171814
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_room_id() != 19270.toShort()) {
18181815
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18191816
}
1820-
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_set_changes_listener() != 45584.toShort()) {
1817+
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_set_changes_listener() != 53319.toShort()) {
18211818
throw RuntimeException("UniFFI API checksum mismatch: try cleaning and rebuilding your project")
18221819
}
18231820
if (lib.uniffi_matrix_sdk_crypto_ffi_checksum_method_sas_state() != 23775.toShort()) {
@@ -3854,7 +3851,8 @@ public interface OlmMachineInterface {
38543851
fun `exportRoomKeys`(`passphrase`: kotlin.String, `rounds`: kotlin.Int): kotlin.String
38553852

38563853
/**
3857-
* Export all the secrets we have in the store into a [`SecretsBundle`].
3854+
* Export all the secrets we have in the store into a serialized
3855+
* SecretsBundle.
38583856
*
38593857
* This method will export all the private cross-signing keys and, if
38603858
* available, the private part of a backup key and its accompanying
@@ -3866,7 +3864,7 @@ public interface OlmMachineInterface {
38663864
* **Warning**: Only export this and share it with a trusted recipient,
38673865
* i.e. if an existing device is sharing this with a new device.
38683866
*/
3869-
fun `exportSecretsBundle`(): SecretsBundle
3867+
fun `exportSecretsBundle`(): kotlin.String
38703868

38713869
/**
38723870
* Get the backup keys we have saved in our crypto store.
@@ -4857,7 +4855,8 @@ open class OlmMachine: Disposable, AutoCloseable, OlmMachineInterface
48574855

48584856

48594857
/**
4860-
* Export all the secrets we have in the store into a [`SecretsBundle`].
4858+
* Export all the secrets we have in the store into a serialized
4859+
* SecretsBundle.
48614860
*
48624861
* This method will export all the private cross-signing keys and, if
48634862
* available, the private part of a backup key and its accompanying
@@ -4869,8 +4868,8 @@ open class OlmMachine: Disposable, AutoCloseable, OlmMachineInterface
48694868
* **Warning**: Only export this and share it with a trusted recipient,
48704869
* i.e. if an existing device is sharing this with a new device.
48714870
*/
4872-
@Throws(SecretsBundleExportException::class)override fun `exportSecretsBundle`(): SecretsBundle {
4873-
return FfiConverterTypeSecretsBundle.lift(
4871+
@Throws(SecretsBundleExportException::class)override fun `exportSecretsBundle`(): kotlin.String {
4872+
return FfiConverterString.lift(
48744873
callWithHandle {
48754874
uniffiRustCallWithError(SecretsBundleExportException) { _status ->
48764875
UniffiLib.uniffi_matrix_sdk_crypto_ffi_fn_method_olmmachine_export_secrets_bundle(
@@ -7268,7 +7267,7 @@ public interface SasInterface {
72687267
*
72697268
* # Flowchart
72707269
*
7271-
* The flow of the verification process is pictured bellow. Please note
7270+
* The flow of the verification process is pictured below. Please note
72727271
* that the process can be cancelled at each step of the process.
72737272
* Either side can cancel the process.
72747273
*
@@ -7611,7 +7610,7 @@ open class Sas: Disposable, AutoCloseable, SasInterface
76117610
*
76127611
* # Flowchart
76137612
*
7614-
* The flow of the verification process is pictured bellow. Please note
7613+
* The flow of the verification process is pictured below. Please note
76157614
* that the process can be cancelled at each step of the process.
76167615
* Either side can cancel the process.
76177616
*
@@ -12273,6 +12272,14 @@ sealed class SecretsBundleExportException: kotlin.Exception() {
1227312272
get() = ""
1227412273
}
1227512274

12275+
class Serialization(
12276+
12277+
val `error`: kotlin.String
12278+
) : SecretsBundleExportException() {
12279+
override val message
12280+
get() = "error=${ `error` }"
12281+
}
12282+
1227612283

1227712284

1227812285

@@ -12297,6 +12304,9 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1229712304
)
1229812305
2 -> SecretsBundleExportException.MissingCrossSigningKeys()
1229912306
3 -> SecretsBundleExportException.MissingBackupVersion()
12307+
4 -> SecretsBundleExportException.Serialization(
12308+
FfiConverterString.read(buf),
12309+
)
1230012310
else -> throw RuntimeException("invalid error enum value, something is very wrong!!")
1230112311
}
1230212312
}
@@ -12316,6 +12326,11 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1231612326
// Add the size for the Int that specifies the variant plus the size needed for all fields
1231712327
4UL
1231812328
)
12329+
is SecretsBundleExportException.Serialization -> (
12330+
// Add the size for the Int that specifies the variant plus the size needed for all fields
12331+
4UL
12332+
+ FfiConverterString.allocationSize(value.`error`)
12333+
)
1231912334
}
1232012335
}
1232112336

@@ -12334,6 +12349,11 @@ public object FfiConverterTypeSecretsBundleExportError : FfiConverterRustBuffer<
1233412349
buf.putInt(3)
1233512350
Unit
1233612351
}
12352+
is SecretsBundleExportException.Serialization -> {
12353+
buf.putInt(4)
12354+
FfiConverterString.write(value.`error`, buf)
12355+
Unit
12356+
}
1233712357
}.let { /* this makes the `when` an expression, which ensures it is exhaustive */ }
1233812358
}
1233912359

@@ -14397,8 +14417,6 @@ public object FfiConverterMapStringMapStringSequenceString: FfiConverterRustBuff
1439714417

1439814418

1439914419

14400-
14401-
1440214420
/**
1440314421
* Migrate a libolm based setup to a vodozemac based setup stored in a SQLite
1440414422
* store.

crypto/crypto-android/src/main/kotlin/uniffi/matrix_sdk_common/matrix_sdk_common.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ open class RustBuffer : Structure() {
8080

8181
@Suppress("TooGenericExceptionThrown")
8282
fun asByteBuffer() =
83-
this.data?.getByteBuffer(0, this.len.toLong())?.also {
83+
this.data?.getByteBuffer(0, this.len)?.also {
8484
it.order(ByteOrder.BIG_ENDIAN)
8585
}
8686
}
@@ -637,7 +637,7 @@ internal object IntegrityCheckingUniffiLib {
637637
}
638638
external fun ffi_matrix_sdk_common_uniffi_contract_version(
639639
): Int
640-
640+
641641

642642
}
643643

@@ -752,7 +752,7 @@ internal object UniffiLib {
752752
): Unit
753753
external fun ffi_matrix_sdk_common_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
754754
): Unit
755-
755+
756756

757757
}
758758

crypto/crypto-android/src/main/kotlin/uniffi/matrix_sdk_crypto/matrix_sdk_crypto.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ open class RustBuffer : Structure() {
8181

8282
@Suppress("TooGenericExceptionThrown")
8383
fun asByteBuffer() =
84-
this.data?.getByteBuffer(0, this.len.toLong())?.also {
84+
this.data?.getByteBuffer(0, this.len)?.also {
8585
it.order(ByteOrder.BIG_ENDIAN)
8686
}
8787
}
@@ -638,7 +638,7 @@ internal object IntegrityCheckingUniffiLib {
638638
}
639639
external fun ffi_matrix_sdk_crypto_uniffi_contract_version(
640640
): Int
641-
641+
642642

643643
}
644644

@@ -770,7 +770,7 @@ internal object UniffiLib {
770770
): Unit
771771
external fun ffi_matrix_sdk_crypto_rust_future_complete_void(`handle`: Long,uniffi_out_err: UniffiRustCallStatus,
772772
): Unit
773-
773+
774774

775775
}
776776

0 commit comments

Comments
 (0)