Commit Graph

19953 Commits

Author SHA1 Message Date
Jeremy Lainé
5c3a499c9f ssl: disable (broken) i/o on DER encoded keys
QSslKey currently has methods which supposedly allow decoding and
encoding private keys as DER protected by a passphrase. This is
broken by design as explained in QTBUG-41038, as storing the encrypted
DER data alone makes no sense: such a file lacks the necessary
information about the encryption algorithm and initialization vector.

This change:

- explicitly stops using the passphrase when decoding DER in the
  constructor. The behavior is unchanged, it is not possible to
  read the encrypted DER alone.

- refuses to honor the passphrase to DER encode a private key. The toDer
  method now outputs an empty QByteArray instead of garbage.

Task-number: QTBUG-41038
Change-Id: I4281050cf1104f12d154db201a173633bfe22bd9
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-30 17:36:23 +02:00
Jeremy Lainé
2fd0afc1f8 ssl: add a test for 3DES encrypted keys
This adds a test for 3DES encrypted keys in addition to the
current DES encrypted keys.

Change-Id: I229e3ef710e9ee23efa2a3275b89d958491de4a2
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-30 17:24:05 +02:00
Andrew Knight
74a7f13ac1 winrt: Implement missing SSL socket methods
Move from a stub to a functional SSL socket implementation.

This implementation has some limitations. Due to the way the native
SSL upgrade works, it is not possible to ignore SSL errors after the
handshake has begun. The user must set the ignore flags before
connecting to the host.

Due to missing implementation in the underlying native socket, the
synchronous methods (waitForConnected(), waitForDisconnected()) are not
functional either. Users must rely on the asynchronous methods instead.
This is not a problem in the general case, as HTTP(S) is not affected.

SSL server sockets are not supported by the native API, so it is not
possible to bind an SSL server socket.

Change-Id: Id0b323f273892580b294aa5a6ff601a8241470df
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-08-30 08:21:10 +02:00
Oliver Wolff
5328ec7e10 winrt: complete QSslCertificate implementation
The native handle and import functions are now available for use in other
parts of the winrt backend.

Change-Id: I07e6f95b3411c3dc7c1a7a164544b18e5e435d01
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-30 08:20:51 +02:00
Jeremy Lainé
6a4cb8d62b ssl: Add common key parser for backends
This internal implementation of QSslKey can be used when OpenSSL is not
available. Encrypted keys are not supported, as the cryptography must
be supplied by a separate library.

With this commit, WinRT is migrated to the new implementation,
but qsslkey_winrt.cpp is left in place so that the missing crypto
implementation can be added later. This also means most of the expected
failures for that platform can be removed from the autotest.

Change-Id: I24a3ad1053bb72311613b28b3ae845aa1645a321
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-29 23:18:22 +02:00
Friedemann Kleint
def5a56b03 Add Q_ENUMS to QStyle's enumerations.
This makes it significantly easier to obtain debug output
for style functionality.

Task-number: QTBUG-38858
Change-Id: I19edc834a55fa369b6830abeb4697ae5e5ded995
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-29 16:34:06 +02:00
Friedemann Kleint
83dab766fc Windows: Fix QPlatformCursor::pos()/setPos() for DPR scaling.
Task-number: QTBUG-38858
Change-Id: Ibb0355ae19a382e4eb3805fe6d6afab2a2a603e6
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-29 09:51:48 +02:00
Lars Knoll
1d66c9eba8 Fix nativeRead() for maxlen greater than UINT_MAX
Don't truncate the maxlen to a DWORD. Instead read all
data incrementally up t maxlen.

Task-number: QTBUG-27796

Change-Id: I21c34d11046f1106244dcd77420cc472e7240e68
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-08-29 09:32:30 +02:00
Christoph Schleifenbaum
fc4993be1f QListView: Catch stack overflow on mutual scrollbar calculation.
Task-number: QTBUG-39902
Change-Id: Ie850371098070e8ce485d5cb122aa89c18d97359
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-29 07:26:29 +02:00
Topi Reinio
e4a778d9c2 qdoc: Use qdoc error logging for warnings related to index files
Make the warnings that are displayed during the reading of index
files and dependencies more consistent by using QDoc's error
logging functions.

This means that warnings are not generated in prepare phase,
but they are generated for projects that call qdoc directly,
running prepare and generate phases in one go.

Change-Id: I645c3feb1cbf471fd3ca6034f94e7dc1ea35b875
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-29 00:22:03 +02:00
Friedemann Kleint
1b32e8d7d4 Windows: Detect Surface Pro 2 tablets.
Task-number: QTBUG-39571
Change-Id: I9cb7fe2dee9a0701912ea639cdcc66a198e5b65c
Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
2014-08-28 16:43:30 +02:00
Friedemann Kleint
0aa84a619e QLineEdit: Disable standard key 'cut' when there is no selection.
Task-number: QTBUG-40477
Change-Id: I0741a1a769c9e7e0d19e8aec231acc29461d44ea
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-28 16:19:36 +02:00
Robin Burchell
9b599c6cea tst_qstatusbar: Allow a little more leeway in timer checking.
Timer granularity means that sometimes this won't wait the full timeout before
vanishing the message. Add some extra tolerance so we don't unnecessarily fail
integrations.

Change-Id: I203ac16cda7bd1f0437dd3febc0509c17e86c25a
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2014-08-28 13:59:37 +02:00
Samuel Gaist
6f52256dc2 Doc: properties, add missing parenthesis
Change-Id: I97b5a96b29416ca7af145edb1a6a96595c9524da
Reviewed-by: Alex Blasche <alexander.blasche@digia.com>
2014-08-28 13:55:28 +02:00
Jeremy Lainé
d4dc3159c7 Check certificate nullity instead of handle
This changes tests which use QSslCertificate::handle() to determine
if a certificate is null to use QSslCertificate::isNull() instead.

This is required for non-OpenSSL backends which do not actually
expose a private handle.

Change-Id: I9523ba0dd00d47ba337b543ad34840125db99bfb
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
2014-08-28 13:33:46 +02:00
Friedemann Kleint
4354fef3d4 Windows: Prevent hidden transient children from being re-shown by Windows.
Bring back code from Qt 4 to handle WM_SHOWWINDOW / SW_PARENTOPENING
correctly.

Task-number: QTBUG-40696
Change-Id: If018bf90573f495dbe32d0c46f522ccde0691ebb
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-28 13:26:06 +02:00
Friedemann Kleint
2d12ef0be0 Adapt the Vista-style wizard for device pixel ratio scaling.
Task-number: QTBUG-38993
Task-number: QTBUG-388583
Change-Id: I1e3f1b5c82b9751e7f2aa6aed3d89d4388ecf1ce
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-28 11:35:07 +02:00
Friedemann Kleint
ce94cdbe50 QWidget::save/restoreGeometry(): Check screen size.
Bump minor version of the saved geometry and append
the screen width in version 1.1. Use that to check and bail out should
large differences occur due to scaling or different levels of DPI
awareness.

Task-number: QTBUG-38858
Change-Id: Iad8ae0705297118b4237c9a41469cb97d7eab549
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-28 11:35:01 +02:00
Allan Sandfeld Jensen
f2e26d7dbb Code cleaning in qt_gl_resolve_extensions
Moves feature checks so OpenGL vs OpenGLES is only tested one way
and extensions so they are not tested if already required by their
version.

Change-Id: Ia77f6ea924559fa7a428beb6316ae392063dfc4f
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-28 11:32:57 +02:00
Michael Brüning
6b52e6ead9 Let ANGLE use multithreaded devices if necessary.
This is needed to prevent lock-ups in application that use ANGLE from
multiple threads, as e.g. QtWebEngine based applications do.

The environment variable QT_D3DCREATE_MULTITHREADED is used to
communicate this from the QtWebEngine module.

Change-Id: Ibd5a5c75eb68af567d420d9a35efb3490c93b27c
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
2014-08-28 11:09:55 +02:00
Jędrzej Nowacki
918038ad57 Mark QByteArrayList as metatype built-in type.
As a side effects it also adds core templates types to the tests

Change-Id: I0e3338e0bffdf21982aa83d404c83288e54411f4
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
2014-08-28 10:13:04 +02:00
Marc Mutz
e311f7ac8b QWindowsNativeInterface: don't allocate memory just to compare strings
Change-Id: I691d2629a78aaaee3d1741b9ab4c55b16c95bde9
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-28 09:53:23 +02:00
Marc Mutz
2e3facf419 Micro-optimize QVector::count()
...by instantiating std::count() not with QVector::const_iterator, which is a
class, but with const T*, thus increasing the chance that the instantiation
can be shared with other instantiations in the executable. It might also enable
STL implementations to choose a hand-optimized version of the algorithm for C++
builtin types.

Change-Id: I93df4e58f76838d98b565f229c19e317774b7b4c
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-28 09:53:03 +02:00
Marc Mutz
f563124eee QList: check d for equality before d->size for inequality
Same change as was already applied to QVector::operator==().

Change-Id: Ic2e140a52ee95f2e215668077951de0b4450d194
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-28 09:52:43 +02:00
Marc Mutz
f90308c0c3 QVector: check d for equality before d->size for inequality
Assuming the CPU has already loaded 'this', the value of 'd' is just
an indirect load away. The value of d->size, however, is two indirect
loads away, one of which is the load of 'd'.

So it makes more sense to check for d-pointer equality first, as that
can proceed in parallel with the fetch for d->size, which the CPU
may speculatively trigger.

In addition, at least GCC in release mode after this change doesn't
set up the stack frame if the d-pointer check succeeds.

Change-Id: I61f9b245070dd1742fca6ccb8d4936a0b1aa7c07
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2014-08-28 09:52:36 +02:00
Andrew Knight
da72e1b0e8 winrt: Refactor internal socket buffer
Simplify the temporary buffer usage by using the built-in WinRT Buffer
class. This also allows one use of the local event loop to be removed.

Change-Id: Ice552910227ffbe31c6e8716ff7896af7c4532ef
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-08-28 05:59:15 +02:00
Andrew Knight
dd305aee78 winrt: Fix socket descriptor storage in native socket engine
This stores the socket pointer in the descriptor, rather than an
abitrary handle, so that it is easier to access from e.g. SSL socket.

To further support SSL sockets, a special case for SSL sockets is
made so that the the socket reader installation can be delayed until
after the socket is encrypted (as this is the only supported mode of
operation with StreamSocket).

Change-Id: I693229189722dc43b221b167e8256f5497a50346
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
2014-08-28 05:58:43 +02:00
Andrew Knight
6d57f3f27e network: Add pending close on disconnect for non-empty write buffer
Similarly to 1b19f660 (which added socket flushing before close), the
socket should have a chance to disconnect if the write buffer is not
empty. Instead of flushing, the pendingClose is added so that the
backend may disconnect the socket once these bytes have been written.

Change-Id: I2d85b6356c3e158bade3d5d86161d3e33649cad6
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-28 05:58:22 +02:00
Andrew Knight
ecbf6dfbf5 ssl: Share the host name matching utilities
This moves the socket backend's host name matching functions up to
QSslSocketPrivate so that they can be shared between backends. This
works, as there is no OpenSSL-specific code here.

Change-Id: I73c2081fdc2e60a44c90e90800d1e1877391a626
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-27 15:03:58 +02:00
Nico Vertriest
be4db73231 Doc: language corrections QStorageInfo class
Task-number: QTBUG-40984
Change-Id: Idf8c6ecedb25f6c55b3fe8db69e6de9d9f2eaf74
Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-27 14:45:18 +02:00
Risto Avila
e5b36bb54e Enables remap of NumpadKeys when Numlock is on and using evkeyboard.
Task-number: QTBUG-32823
Change-Id: I80841a965c61a117e8b50a2775431bb723ca8eca
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
2014-08-27 14:38:11 +02:00
Marc Mutz
53eeddf855 Use ctor-init-list in QRegionPrivate(QRect) ctor
Change-Id: I531b862db7bdec0a504c6022c1a15635aaf3fc8d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-26 20:47:47 +02:00
Marc Mutz
2b153ad6cb QRegionPrivate: remove copy ctor and assignment operator
They're identical to the compiler-generated ones, and probably inhibit
move operators here and there.

Change-Id: I918f2946f6b6aa49aa883420dc87df44013938a5
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2014-08-26 20:47:41 +02:00
Topi Reinio
15c32361d9 qdoc: Enable listing of example files with .html extension
If a (non-external) link string ends in '.html', qdoc assumed it is
a direct link to a generated html page. However, it could also refer
to an example file with .html extension.

This commit fixes a corner case where links to an example file page
were broken for such files.

Task-number: QTBUG-40831
Change-Id: I31acc141970b6768f0a93964723be82611d37a3d
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:58 +02:00
Topi Reinio
d28e2e225c qdoc: Restore navigation bar title for module pages and groups
Adapt the code that generates the navigation bar to the recent
changes in node hierarchy - Module pages, QML module pages and
groups are no longer DocNodes.

This change will ensure that if a page has a title, it will be
visible in the navigation bar regardless of the the page (node)
type.

Change-Id: I697a12d5904d88f91771764ab7ed607b79e4eab1
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-26 20:08:40 +02:00
Topi Reinio
f286e0813b Doc: Add CSS rules for subtitles
In the offline template, the floating elements in the navigation bar
interfere with the layout of any elements displayed next to it. In
particular, subtitles used for example files and nested class
documentation have wrong horizontal position.

This change adds CSS for the subtitles to be displayed as block
elements, and disallows floating elements on the left side - TOC
is still allowed to float on the right side.

Task-number: QTBUG-40924
Change-Id: I89be3844985e6cf95263db575768034d9270d140
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:21 +02:00
Topi Reinio
4cc3a41819 qdoc: Write all generated files to .qhp
When writing the Qt Help Project XML file, QDoc traverses the
documentation nodes recursively, adding html filenames for each node
to the XML.

The logic that QDoc uses for this process is not perfect, and needs
to be kept up to date whenever the internal structure of the node
tree changes. This often leads to problems where some pages are
generated but not added to the .qhp, resulting in missing pages in
the offline documentation.

This change fixes this problem by having the generator keep track
of the created filenames, and passing that to the help project
writer.

Task-number: QTBUG-40572
Change-Id: Ife60a30724183a2b6dcd2397ea79bfbdc2addd04
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 20:08:05 +02:00
Topi Reinio
4f2d1e2e04 qdoc: Fix output of \br command
Since the \br was promoted from a macro to a QDoc command, its output
has been enclosed in extra paragraph end/start tags, adding to the
visible vertical space.

This change fixes the issue by not closing the paragraph when QDoc
encounters a \br command.

Also removes the now-obsolete \br and \hr macros, as they are both
proper commands. \BR and \HR substitute macros are kept.

Task-number: QTBUG-37361
Change-Id: Iabbefb6e79268419792ccba42386f6342ccd175d
Reviewed-by: Martin Smith <martin.smith@digia.com>
2014-08-26 20:07:40 +02:00
Friedemann Kleint
92c7cb8155 Close popup widgets when wheel events are received
Task-number: QTBUG-40656
Change-Id: I134b07705744c23af9718dee486ab5e9ad4352cf
Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
2014-08-26 19:58:56 +02:00
Oliver Wolff
0475822d01 Added qsslcertificate_qt.cpp
Having QAsn1Element in place, we can have a common foundation
for the ssl certificate class for upcoming ports like WinRT
and SecureTransport. The only thing that has to be added to
the existing class is the handle() functionality.

Change-Id: I560a8e412b26f350855c7bc456fcdb8e9b750939
Reviewed-by: Richard J. Moore <rich@kde.org>
2014-08-26 18:48:36 +02:00
Tor Arne Vestbø
852dbe7658 iOS: Use dispatch_async instead of performSelectorOnMainThread for IME
Gets rid of awkward wrapping of Qt::InputMethodQueries as integer in a
NSObject.

Change-Id: Ia7e368fc12ec7957ca8ab602d8cec1e0a071af1d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 18:13:04 +02:00
Tor Arne Vestbø
ad120dbf13 iOS: Add UIResponder helper to get current first responder
Change-Id: I422d45860a52861893d963fabbecd4ac30477272
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 18:12:50 +02:00
Morten Johan Sørvig
7a413fa40c QCoreTextFontDatabase: Remove number type asserts.
On iOS 8, the value 0 is returned as a kCFNumberIntType.
The code still works - CFNumberGetValue converts it
to a 0.0 double.

Change-Id: Ic50900b22e4fa19ad1481e8e0e293559bbfd8cd2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
2014-08-26 18:12:44 +02:00
Tor Arne Vestbø
9aff2fbd86 Send QWindow::focusObjectChanged when clearing widget focus
We do this for QWidget::setFocus(), but were missing a call on clearing
the focus widget. Since QWidgetWindow::focusObject() will fall back to
returning itself if there is no focus widget, we need to pass the
result of window->focusObject() to the change signal instead of 0.

Change-Id: I52a5519a19bb20e74b4a7c2a1abc9d47e2ea1315
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 18:12:37 +02:00
Friedemann Kleint
f85f3acd78 Document loading of high resolution versions of images.
Task-number: QTBUG-38858
Change-Id: I87ee18b66e137f5f5c01d77910f1a7f256b85e18
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-08-26 16:59:36 +02:00
Friedemann Kleint
4017605d56 Mention supportedMimeTypes() in QImageReader documentation.
Change-Id: Iaa07a463e07982352fe2c7dd77d691a390a65f35
Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
2014-08-26 16:59:28 +02:00
Frederik Gladhorn
910c639db6 Accessibility iOS: Fix crash after deleting a view
Change-Id: I64e8357fcbf7f312308490351b7c692d31db5a43
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
2014-08-26 16:40:46 +02:00
Frederik Gladhorn
de95953c75 Clean up QAccessibleTabBar
Change-Id: Ic0949e4d76a7332ef1a42c93a06a0e4515c1192d
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 16:40:43 +02:00
Frederik Gladhorn
e944b93bf1 Remove QAccessibleToolButton::text
This function actually is worse than just calling
QAccessibleButton::text which it already does. It would mess up the
shortcut handling in addition to that.

Change-Id: I56cb95a44624da4c5fccb43e6835f6012a083337
Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
2014-08-26 16:40:40 +02:00
Frederik Gladhorn
0c3967f92c Remove unused variable
Change-Id: I0414d7bab89371f330d5b0cfa88758e3f1668f32
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2014-08-26 16:40:37 +02:00