Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-38238

Qt.btoa and Qt.md5 convert input to UTF8 before hashing

    XMLWordPrintable

Details

    Description

      Calling Qt.btoa or Qt.md5 with binary data yields unexpected output due to QV4 converting the input contents to QString before hashing.

      Calling these methods on binary data will fail to operate correctly on the data.

      Example attached.

      Patch attached, which converts using toVariant instead. Generated against git master, but it applies cleanly on 5.3.0Beta1 also.

      This patch does not address conversion of binary ArrayBuffer contents (or Uint8Array) as they appear to be universally unimplemented in V4 at this point.

      Attachments

        1. btoa_md5_binary_use_variant.patch
          2 kB
          d francis o'neill
        2. btoa_md5_broken.png
          51 kB
          d francis o'neill
        3. btoa_md5_working.png
          65 kB
          d francis o'neill
        4. qmltexttest.tar.xz
          12 kB
          d francis o'neill
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            shausman Simon Hausmann
            doneill d francis o'neill
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes