mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
scr session resumption example
This commit is contained in:
@@ -694,8 +694,15 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
|
|||||||
if (nonBlocking) {
|
if (nonBlocking) {
|
||||||
printf("not doing secure renegotiation on example with"
|
printf("not doing secure renegotiation on example with"
|
||||||
" nonblocking yet");
|
" nonblocking yet");
|
||||||
|
} else {
|
||||||
|
#ifndef NO_SESSION_CACHE
|
||||||
|
if (resumeSession) {
|
||||||
|
session = CyaSSL_get_session(ssl);
|
||||||
|
CyaSSL_set_session(ssl, session);
|
||||||
|
resumeSession = 0; /* only resume once */
|
||||||
}
|
}
|
||||||
else if (CyaSSL_Rehandshake(ssl) != SSL_SUCCESS) {
|
#endif
|
||||||
|
if (CyaSSL_Rehandshake(ssl) != SSL_SUCCESS) {
|
||||||
int err = CyaSSL_get_error(ssl, 0);
|
int err = CyaSSL_get_error(ssl, 0);
|
||||||
char buffer[CYASSL_MAX_ERROR_SZ];
|
char buffer[CYASSL_MAX_ERROR_SZ];
|
||||||
printf("err = %d, %s\n", err,
|
printf("err = %d, %s\n", err,
|
||||||
@@ -703,6 +710,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args)
|
|||||||
err_sys("CyaSSL_Rehandshake failed");
|
err_sys("CyaSSL_Rehandshake failed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif /* HAVE_SECURE_RENEGOTIATION */
|
#endif /* HAVE_SECURE_RENEGOTIATION */
|
||||||
|
|
||||||
if (sendGET) {
|
if (sendGET) {
|
||||||
|
@@ -8960,6 +8960,10 @@ static void PickHashSigAlgo(CYASSL* ssl,
|
|||||||
|
|
||||||
ssl->options.serverState = SERVER_HELLO_COMPLETE;
|
ssl->options.serverState = SERVER_HELLO_COMPLETE;
|
||||||
|
|
||||||
|
if (ssl->keys.encryptionOn) {
|
||||||
|
*inOutIdx += ssl->keys.padSz;
|
||||||
|
}
|
||||||
|
|
||||||
if (ssl->options.resuming) {
|
if (ssl->options.resuming) {
|
||||||
if (ssl->options.haveSessionId && XMEMCMP(ssl->arrays->sessionID,
|
if (ssl->options.haveSessionId && XMEMCMP(ssl->arrays->sessionID,
|
||||||
ssl->session.sessionID, ID_LEN) == 0) {
|
ssl->session.sessionID, ID_LEN) == 0) {
|
||||||
@@ -8998,10 +9002,6 @@ static void PickHashSigAlgo(CYASSL* ssl,
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ssl->keys.encryptionOn) {
|
|
||||||
*inOutIdx += ssl->keys.padSz;
|
|
||||||
}
|
|
||||||
|
|
||||||
return SetCipherSpecs(ssl);
|
return SetCipherSpecs(ssl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user