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

SSL crash in Android 6 (Marshmallow)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 5.4.1
    • QPA
    • None
    • Android 6.0, LG Nexus 5
      compiled using Qt5.4.1, android_armv5, android-ndk-r10
    • Android

    Description

      SSL Connection crashes all the time in Android 6 (tested only with one device so far)

      test.cpp
      QSslSocket::supportsSsl() // true
      QSslSocket::sslLibraryVersionString(); // "BoringSSL"
      QSslSocket::sslLibraryBuildVersionString(); // "OpenSSL 1.0.1j 15 Oct 2014"
      
      QSslSocket sslSocket;
      sslSocket.setProtocol(QSsl::SecureProtocols);
      QSslCertificate cert = QSslCertificate(ourcacert);
      QList<QSslCertificate> certs;
      certs.append(cert);
      sslSocket.setCaCertificates(certs);
      sslSocket.connectToHostEncrypted("xyz.com", 443);
      
      bool res = sslSocket.waitForConnected(); // place where it crashes
      ...
      
      

      Error happens even if I do non blocking connection, dumps are same, only difference in non blocking it comes from EventLoop, in blocking it crashes immediately

      ....
      SIGSEGV
       1  libcrypto.so + 0x5fa57
          Found by: stack scanning
       2  libcrypto.so + 0x64101
          Found by: stack scanning
       3  libcrypto.so + 0x640bf
          Found by: stack scanning
       4  libQt5Network.so!__bswapsi2 + 0x1d0ca
          Found by: stack scanning
       5  libQt5Network.so!_ZNK15QSslCertificate23subjectAlternativeNamesEv + 0x73be
          Found by: stack scanning
       6  libQt5Network.so!_ZNK15QSslCertificate23subjectAlternativeNamesEv + 0x842
          Found by: stack scanning
       7  libc.so + 0x75592
          Found by: stack scanning
       8  libQt5Network.so!_ZNK15QSslCertificate23subjectAlternativeNamesEv + 0x334a
          Found by: stack scanning
       9  libc.so + 0x75592
          Found by: stack scanning
      10  libQt5Network.so!_ZNK15QSslCertificate23subjectAlternativeNamesEv + 0x4646
          Found by: stack scanning
      11  libQt5Network.so!_ZN10QSslSocket11modeChangedENS_7SslModeE + 0x2a
          Found by: stack scanning
      12  libQt5Network.so!_ZN10QSslSocket21startClientEncryptionEv + 0xca
          Found by: stack scanning
      13  libQt5Network.so!_ZN10QSslSocket19waitForDisconnectedEi + 0x232
          Found by: stack scanning
      14  libQt5Network.so!_ZN10QSslSocket23addDefaultCaCertificateERK15QSslCertificate + 0x256
      ....
      

      this logic worked fine until Android 6.

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              esabraha Eskil Abrahamsen Blomfeldt
              ikhahmedov Ikhtiyor
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes