File: 40_srptest_doubletimeout.diff

package info (click to toggle)
gnutls28 3.8.9-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 83,872 kB
  • sloc: ansic: 388,071; asm: 117,804; sh: 18,477; makefile: 6,732; yacc: 1,858; python: 1,399; cpp: 1,243; perl: 995; sed: 16
file content (47 lines) | stat: -rw-r--r-- 1,521 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Description: Increase timeout for srp test, fixing build error on mipsel
Author: Andreas Metzler <ametzler@debian.org>
Origin: vendor
Bug: https://gitlab.com/gnutls/gnutls/-/issues/1354
Last-Update: 2023-06-03

--- a/tests/srp.c
+++ b/tests/srp.c
@@ -46,10 +46,12 @@ int main(void)
 #include <assert.h>
 #include <gnutls/gnutls.h>
 
 #include "utils.h"
 
+#define SRPTIMEOUTMULTIPLIER 2
+
 static void terminate(void);
 
 /* This program tests the SRP and SRP-RSA ciphersuites.
  */
 
@@ -126,11 +128,11 @@ static void client(int fd, const char *p
 	 */
 	gnutls_init(&session, GNUTLS_CLIENT);
 
 	/* Use default priorities */
 	assert(gnutls_priority_set_direct(session, prio, NULL) >= 0);
-	gnutls_handshake_set_timeout(session, get_timeout());
+	gnutls_handshake_set_timeout(session, get_timeout() * SRPTIMEOUTMULTIPLIER );
 
 	/* put the anonymous credentials to the current session
 	 */
 	gnutls_credentials_set(session, GNUTLS_CRD_SRP, srp_cred);
 	gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, x509_cred);
@@ -220,11 +222,11 @@ static void server(int fd, const char *p
 
 	gnutls_credentials_set(session, GNUTLS_CRD_SRP, s_srp_cred);
 	gnutls_credentials_set(session, GNUTLS_CRD_CERTIFICATE, s_x509_cred);
 
 	gnutls_transport_set_int(session, fd);
-	gnutls_handshake_set_timeout(session, get_timeout());
+	gnutls_handshake_set_timeout(session, get_timeout() * SRPTIMEOUTMULTIPLIER );
 
 	do {
 		ret = gnutls_handshake(session);
 	} while (ret < 0 && gnutls_error_is_fatal(ret) == 0);
 	if (ret < 0) {