summaryrefslogtreecommitdiffstats
path: root/tests/auto/network/ssl/qdtls
Commit message (Collapse)AuthorAgeFilesLines
* tst_qdtls: add 'invalidConfiguration' testTimur Pocheptsov2018-08-101-0/+15
| | | | | | | | | | Test that we don't silently replace an invalid TLS configuration with the default one (for now, the only thing that is considered to be non-valid - is having non-DTLS protocol set). Change-Id: I6f714b009cf1345a085a3f26d638fc31330f1a94 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDtls: delay protocol version verificationTimur Pocheptsov2018-08-101-6/+0
| | | | | | | | | | | | | | | | | | | A weird behavior of the DTLS server example, when linked with 1.0.2, exposed that client code, requesting an invalid protocol (for example, SSLv3) can end-up with connection encrypted with DTLS 1.2 (which is not that bad, but totally surprising). When we check the protocol version early in setDtlsConfiguration() and find a wrong version, we leave our previous configuration intact and we will use it later during the handshake. This is wrong. So now we let our user set whatever wrong configuration they have and later fail in TLS initialization, saying - 'Unsupported protocol, DTLS was expected'. Auto-test was reduced - the follow-up patch will introduce a new 'invalidConfiguration' auto-test. Change-Id: I9be054c6112eea11b7801a1595aaf1d34329e1d2 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Extend 'ignoreExpectedErrors' testTimur Pocheptsov2018-08-021-9/+28
| | | | | | | | | with a case when we fail to ignore/pre-set one of possible verification errors. Change-Id: I23b06243b61acef1ef3576c51529f3ef6601ba7d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QDtls: respect pre-set verification errorsTimur Pocheptsov2018-07-311-0/+27
| | | | | | | | | | That's actually how ignoreVerificationErrors (and QSslSocket::ignoreSslErrors) are used to set the expected/known verification errors before handshake. Auto-test updated too. Change-Id: I9c700302d81ddb383a4a750fafd594373fb38ace Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDtls - use conventional namesTimur Pocheptsov2018-07-271-24/+24
| | | | | | | | More Qt-style and more natural, also, shorter names. Change-Id: I97bd68a8614126d518a3853027661435dc4e080d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QDtls - refactorTimur Pocheptsov2018-07-261-28/+28
| | | | | | | | | This patch renames rather awkward 'remote' into more conventional 'peer' (similar to what we have in QAbstractSocket). Change-Id: Ifc45e538b8adf9cc076bd7aee693277829fd94dc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* prune cargo-culted and obsolete winsock deps from autotestsOswald Buddenhagen2018-07-191-1/+0
| | | | | Change-Id: I9666598d34e965d7058aeb2b2e7fb3f59600675c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QDtls - handle server-side timeoutsTimur Pocheptsov2018-07-051-1/+6
| | | | | | | | | | | | | According to RFC 6347 a DTLS server also must retransmit buffered message(s) if timeouts happen during the handshake phase (so it's not a client only as I initially understood it). Conveniently so an auto-test is already in place and needs just a tiny adjustment - handshakeWithRetransmission covers both sides. Change-Id: If914ec3052e28ef5bf12a40e5eede45bbc53e8e0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Add tst_QDtls auto-testTimur Pocheptsov2018-06-2114-0/+1580
The test is somewhat similar to tst_QSslSocket but is smaller (in scope, will grow in future), it has no QTcpSocket/QAbstractSocket-specific things and has more DTLS-specific code. At the moment it does not use our network test server, all work is done in the same process with two QUdpSockets and two QDtls objects. We test (both on client/server ends): - parameters validation (for all functions that do this) and the correctness of error codes/handshake states - handshake procedure (with/out certificates and with pre-shared keys) - timeouts and re-transmissions during (D)TLS handshake - peer verification (and related verification errors) - aborted/resumed handshake - encrypted I/O - DTLS shutdown For now, this test is OpenSSL-only. Task-number: QTBUG-67597 Change-Id: I27006bfe3d6c02b89596889e8482a782c630402a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>