Skip to content

Commit

Permalink
Cleanup client-tls-resume and add new apps to git ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
embhorn committed Feb 6, 2023
1 parent b1d05ac commit 4caa88e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ android/wolfssljni-ndk-sample/proguard-project.txt
/dtls/client-dtls-shared
/dtls/client-dtls
/dtls/client-udp
/dtls/client-dtls13
/dtls/server-dtls-callback
/dtls/server-dtls-ipv6
/dtls/server-dtls-nonblocking
/dtls/server-dtls-threaded
/dtls/server-dtls
/dtls/server-udp
/dtls/server-dtls13

/psk/client-psk-bio-custom
/psk/client-psk-nonblocking
Expand Down Expand Up @@ -106,7 +108,7 @@ android/wolfssljni-ndk-sample/proguard-project.txt
/tls/server-tls-uart
/tls/server-tls-verifycallback
/tls/server-tls-writedup

/tls/server-tls-poll-perf


crypto/3des/3des-file-encrypt
Expand Down
12 changes: 10 additions & 2 deletions tls/client-tls-resume.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ int main(int argc, char** argv)
return 0;
}

#ifdef DEBUG_WOLFSSL
wolfSSL_Debugging_ON();
#endif


/* Initialize wolfSSL */
Expand Down Expand Up @@ -174,11 +177,13 @@ int main(int argc, char** argv)


/* Save the session */
session = wolfSSL_get_session(ssl);
session = wolfSSL_get1_session(ssl);

/* Close the socket */
wolfSSL_free(ssl);
ssl = NULL;
close(sockfd);
sockfd = SOCKET_INVALID;



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

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

Expand Down Expand Up @@ -275,6 +281,8 @@ int main(int argc, char** argv)
/* Cleanup and return */
if (ssl)
wolfSSL_free(ssl); /* Free the wolfSSL object */
if (sslRes)
wolfSSL_free(sslRes); /* Free the wolfSSL object */
#ifdef OPENSSL_EXTRA
if (session)
wolfSSL_SESSION_free(session);
Expand Down
4 changes: 2 additions & 2 deletions tls/client-tls13-resume.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,8 @@ int main(int argc, char** argv)

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

Expand Down

0 comments on commit 4caa88e

Please sign in to comment.