unsigned int context, X509 *x,
size_t chainidx)
{
- char identity[PSK_MAX_IDENTITY_LEN + 1];
const unsigned char *id = NULL;
size_t idlen = 0;
SSL_SESSION *psksess = NULL;
return EXT_RETURN_FAIL;
}
+#ifndef OPENSSL_NO_PSK
if (psksess == NULL && s->psk_client_callback != NULL) {
+ char identity[PSK_MAX_IDENTITY_LEN + 1];
unsigned char psk[PSK_MAX_PSK_LEN];
size_t psklen = 0;
OPENSSL_cleanse(psk, psklen);
}
}
+#endif /* OPENSSL_NO_PSK */
SSL_SESSION_free(s->psksession);
s->psksession = psksess;
return 1;
}
+#ifndef OPENSSL_NO_PSK
static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *id,
unsigned int max_id_len,
unsigned char *psk,
return psklen;
}
+#endif /* OPENSSL_NO_PSK */
static int find_session_cb(SSL *ssl, const unsigned char *identity,
size_t identity_len, SSL_SESSION **sess)
return 1;
}
+#ifndef OPENSSL_NO_PSK
static unsigned int psk_server_cb(SSL *ssl, const char *identity,
unsigned char *psk, unsigned int max_psk_len)
{
return psklen;
}
+#endif /* OPENSSL_NO_PSK */
#define MSG1 "Hello"
#define MSG2 "World."
SSL_CTX_set_psk_use_session_callback(cctx, use_session_cb);
SSL_CTX_set_psk_find_session_callback(sctx, find_session_cb);
}
+#ifndef OPENSSL_NO_PSK
if (idx == 1 || idx == 2) {
SSL_CTX_set_psk_client_callback(cctx, psk_client_cb);
SSL_CTX_set_psk_server_callback(sctx, psk_server_cb);
}
+#endif
srvid = pskid;
use_session_cb_cnt = 0;
find_session_cb_cnt = 0;
#endif
#ifndef OPENSSL_NO_TLS1_3
ADD_TEST(test_ciphersuite_change);
+#ifdef OPENSSL_NO_PSK
+ ADD_ALL_TESTS(test_tls13_psk, 1);
+#else
ADD_ALL_TESTS(test_tls13_psk, 3);
+#endif /* OPENSSL_NO_PSK */
ADD_ALL_TESTS(test_custom_exts, 5);
ADD_TEST(test_stateless);
ADD_TEST(test_pha_key_update);