ChatSecure / ChatSecure-iOS

ChatSecure is a free and open source encrypted chat client for iOS that supports OTR and OMEMO encryption over XMPP.
https://chatsecure.org
Other
3.13k stars 1.03k forks source link

Chatsecure fails to download aesgcm when there is an IDN character in the domain name. #1190

Open FennyFatal opened 4 years ago

FennyFatal commented 4 years ago

Example aesgcm url that breaks FileTransfer:

aesgcm://ᐁ.cc:5281/upload/BaaYRWXwqI0H2a4_/GNCwmaeNT-O77Q3v1HVdvA.jpg#cf11ea282f8d2a67a1195cb6fd224c1830a56191bd5c412f3390c7755317bf13f85e26790c7ec2bb62d9e46a9e914bdd

FennyFatal commented 4 years ago

I don't actually have an iOS device to test with, but my first suspicions are:

Perhaps the regular expression generated here does not handle IDN characters properly.

https://github.com/ChatSecure/ChatSecure-iOS/blob/0f516da16348e7ec3934d09fbb893540e0250716/ChatSecureCore/Classes/Controllers/FileTransferManager.swift#L934

Perhaps the native iOS layer does not handle the IDN character properly here:

https://github.com/ChatSecure/ChatSecure-iOS/blob/0f516da16348e7ec3934d09fbb893540e0250716/ChatSecureCore/Classes/Controllers/FileTransferManager.swift#L598

FennyFatal commented 4 years ago

I have looked into the specification for the RFC, and I can confirm that the url is meant to be sent over the wire as unicode, and not punycoded, so this ought not to be a server-side change.