Skip to content

Commit

Permalink
Merge pull request #80 from xmtp/np/fix-tls-issues
Browse files Browse the repository at this point in the history
Fix TLS issues, consent syncing, and installation signatures
  • Loading branch information
nplasterer authored Nov 19, 2024
2 parents f495d4f + 6e016fa commit a898c6e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
4 changes: 2 additions & 2 deletions LibXMTP.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'LibXMTP'
s.version = '3.0.1'
s.version = '3.0.2'
s.summary = 'XMTP shared Rust code that powers cross-platform SDKs'

s.homepage = 'https://github.com/xmtp/libxmtp-swift'
Expand All @@ -10,7 +10,7 @@ Pod::Spec.new do |s|
s.platform = :ios, '14.0', :macos, '11.0'
s.swift_version = '5.3'

s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-29a955a/LibXMTPSwiftFFI.zip", :type => :zip }
s.source = { :http => "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-f049bb5/LibXMTPSwiftFFI.zip", :type => :zip }
s.vendored_frameworks = 'LibXMTPSwiftFFI.xcframework'
s.source_files = 'Sources/LibXMTP/**/*'
end
4 changes: 2 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ let package = Package(
),
.binaryTarget(
name: "LibXMTPSwiftFFI",
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-29a955a/LibXMTPSwiftFFI.zip",
checksum: "0a5f600d5f12161c461992689f24130d5217c1872f2a83e93cd18d859bf0a233"
url: "https://github.com/xmtp/libxmtp/releases/download/swift-bindings-f049bb5/LibXMTPSwiftFFI.zip",
checksum: "5144ff305e882a0486c82221383bcae927e8f2f2227de940f44ab4114e01d043"
),
.testTarget(name: "LibXMTPTests", dependencies: ["LibXMTP"]),
]
Expand Down
4 changes: 2 additions & 2 deletions Sources/LibXMTP/libxmtp-version.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 29a955a1
Version: f049bb56
Branch: main
Date: 2024-11-14 22:21:21 +0000
Date: 2024-11-18 23:43:59 +0000
20 changes: 20 additions & 0 deletions Sources/LibXMTP/xmtpv3.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3113,6 +3113,8 @@ public protocol FfiXmtpClientProtocol: AnyObject {

func setConsentStates(records: [FfiConsent]) async throws

func signWithInstallationKey(text: String) throws -> Data

func signatureRequest() -> FfiSignatureRequest?
}

Expand Down Expand Up @@ -3485,6 +3487,13 @@ open class FfiXmtpClient:
)
}

open func signWithInstallationKey(text: String) throws -> Data {
return try FfiConverterData.lift(rustCallWithError(FfiConverterTypeGenericError.lift) {
uniffi_xmtpv3_fn_method_ffixmtpclient_sign_with_installation_key(self.uniffiClonePointer(),
FfiConverterString.lower(text), $0)
})
}

open func signatureRequest() -> FfiSignatureRequest? {
return try! FfiConverterOptionTypeFfiSignatureRequest.lift(try! rustCall {
uniffi_xmtpv3_fn_method_ffixmtpclient_signature_request(self.uniffiClonePointer(), $0)
Expand Down Expand Up @@ -5684,6 +5693,8 @@ public enum GenericError {
case Association(message: String)

case DeviceSync(message: String)

case Identity(message: String)
}

#if swift(>=5.8)
Expand Down Expand Up @@ -5755,6 +5766,10 @@ public struct FfiConverterTypeGenericError: FfiConverterRustBuffer {
message: FfiConverterString.read(from: &buf)
)

case 16: return try .Identity(
message: FfiConverterString.read(from: &buf)
)

default: throw UniffiInternalError.unexpectedEnumCase
}
}
Expand Down Expand Up @@ -5791,6 +5806,8 @@ public struct FfiConverterTypeGenericError: FfiConverterRustBuffer {
writeInt(&buf, Int32(14))
case .DeviceSync(_ /* message is ignored*/ ):
writeInt(&buf, Int32(15))
case .Identity(_ /* message is ignored*/ ):
writeInt(&buf, Int32(16))
}
}
}
Expand Down Expand Up @@ -7256,6 +7273,9 @@ private var initializationResult: InitializationResult = {
if uniffi_xmtpv3_checksum_method_ffixmtpclient_set_consent_states() != 64566 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_sign_with_installation_key() != 49813 {
return InitializationResult.apiChecksumMismatch
}
if uniffi_xmtpv3_checksum_method_ffixmtpclient_signature_request() != 18270 {
return InitializationResult.apiChecksumMismatch
}
Expand Down

0 comments on commit a898c6e

Please sign in to comment.