Skip to content

Commit 4caa88e

Browse files
committed
Cleanup client-tls-resume and add new apps to git ignore
1 parent b1d05ac commit 4caa88e

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ android/wolfssljni-ndk-sample/proguard-project.txt
5555
/dtls/client-dtls-shared
5656
/dtls/client-dtls
5757
/dtls/client-udp
58+
/dtls/client-dtls13
5859
/dtls/server-dtls-callback
5960
/dtls/server-dtls-ipv6
6061
/dtls/server-dtls-nonblocking
6162
/dtls/server-dtls-threaded
6263
/dtls/server-dtls
6364
/dtls/server-udp
65+
/dtls/server-dtls13
6466

6567
/psk/client-psk-bio-custom
6668
/psk/client-psk-nonblocking
@@ -106,7 +108,7 @@ android/wolfssljni-ndk-sample/proguard-project.txt
106108
/tls/server-tls-uart
107109
/tls/server-tls-verifycallback
108110
/tls/server-tls-writedup
109-
111+
/tls/server-tls-poll-perf
110112

111113

112114
crypto/3des/3des-file-encrypt

tls/client-tls-resume.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ int main(int argc, char** argv)
6363
return 0;
6464
}
6565

66+
#ifdef DEBUG_WOLFSSL
67+
wolfSSL_Debugging_ON();
68+
#endif
6669

6770

6871
/* Initialize wolfSSL */
@@ -174,11 +177,13 @@ int main(int argc, char** argv)
174177

175178

176179
/* Save the session */
177-
session = wolfSSL_get_session(ssl);
180+
session = wolfSSL_get1_session(ssl);
178181

179182
/* Close the socket */
180183
wolfSSL_free(ssl);
184+
ssl = NULL;
181185
close(sockfd);
186+
sockfd = SOCKET_INVALID;
182187

183188

184189

@@ -197,7 +202,8 @@ int main(int argc, char** argv)
197202

198203
/* Set up to resume the session */
199204
if ((ret = wolfSSL_set_session(sslRes, session)) != WOLFSSL_SUCCESS) {
200-
fprintf(stderr, "ERROR: failed to set session\n");
205+
fprintf(stderr, "Failed to set session, make sure session ticket "
206+
"(--enable-session-ticket) is enabled\n");
201207
goto exit;
202208
}
203209

@@ -275,6 +281,8 @@ int main(int argc, char** argv)
275281
/* Cleanup and return */
276282
if (ssl)
277283
wolfSSL_free(ssl); /* Free the wolfSSL object */
284+
if (sslRes)
285+
wolfSSL_free(sslRes); /* Free the wolfSSL object */
278286
#ifdef OPENSSL_EXTRA
279287
if (session)
280288
wolfSSL_SESSION_free(session);

tls/client-tls13-resume.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ int main(int argc, char** argv)
312312

313313
/* Set up to resume the session */
314314
if ((ret = wolfSSL_set_session(sslRes, session)) != WOLFSSL_SUCCESS) {
315-
fprintf(stderr, "Failed to set session, make sure session tickets "
316-
"(--enable-session ticket) is enabled\n");
315+
fprintf(stderr, "Failed to set session, make sure session ticket "
316+
"(--enable-session-ticket) is enabled\n");
317317
/*goto exit;*/ /* not fatal */
318318
}
319319

0 commit comments

Comments
 (0)