summaryrefslogtreecommitdiff
path: root/tests/rsa-psk-cb.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@redhat.com>2018-03-13 15:46:16 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2018-03-19 17:19:18 +0100
commit80f182e8c205d3b25fedbc629d71abcd2483739e (patch)
tree4958e8376546928ee63f8181fcf8a0342b399927 /tests/rsa-psk-cb.c
parent671826acc0893f05712266a49dac4851c6523bb7 (diff)
downloadgnutls-80f182e8c205d3b25fedbc629d71abcd2483739e.tar.gz
tests: updated for TLS1.3 inclusion
This moves the test to use a specific version or test multiple TLS versions if applicable. Resolves #413 Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Diffstat (limited to 'tests/rsa-psk-cb.c')
-rw-r--r--tests/rsa-psk-cb.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/rsa-psk-cb.c b/tests/rsa-psk-cb.c
index e7223f2d36..6919f7209a 100644
--- a/tests/rsa-psk-cb.c
+++ b/tests/rsa-psk-cb.c
@@ -22,7 +22,7 @@
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
-/* Parts copied from GnuTLS example programs. */
+/* Tests the RSA-PSK ciphersuites under TLS1.2 */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -108,8 +108,8 @@ static void client(int sd)
gnutls_init(&session, GNUTLS_CLIENT);
/* Use default priorities */
- gnutls_priority_set_direct(session, "NORMAL:-KX-ALL:+RSA-PSK",
- NULL);
+ assert(gnutls_priority_set_direct(session, "NORMAL:-VERS-ALL:+VERS-TLS1.2:-KX-ALL:+RSA-PSK",
+ NULL)>=0);
/* put the anonymous credentials to the current session
*/
@@ -228,8 +228,8 @@ static void server(int sd)
/* avoid calling all the priority functions, since the defaults
* are adequate.
*/
- gnutls_priority_set_direct(session, "NORMAL:-KX-ALL:+RSA-PSK",
- NULL);
+ assert(gnutls_priority_set_direct(session, "NORMAL:-VERS-ALL:+VERS-TLS1.2:-KX-ALL:+RSA-PSK",
+ NULL)>=0);
gnutls_credentials_set(session, GNUTLS_CRD_PSK, server_pskcred);
@@ -309,10 +309,15 @@ void doit(void)
if (child) {
int status;
/* parent */
+ close(sockets[1]);
server(sockets[0]);
wait(&status);
- } else
+ check_wait_status(status);
+ } else {
+ close(sockets[0]);
client(sockets[1]);
+ exit(0);
+ }
}
#endif /* _WIN32 */