static int test_tls13_encryption(void)
{
SSL_CTX *ctx = NULL;
- SSL *s = NULL;
+ SSL *ssl = NULL;
SSL3_RECORD rec;
unsigned char *key = NULL, *iv = NULL, *seq = NULL;
const EVP_CIPHER *ciph = EVP_aes_128_gcm();
int ret = 0;
size_t ivlen, ctr;
+ SSL_CONNECTION *s;
/*
* Encrypted TLSv1.3 records always have an outer content type of
goto err;
}
- s = SSL_new(ctx);
- if (!TEST_ptr(s)) {
+ ssl = SSL_new(ctx);
+ if (!TEST_ptr(ssl) || !TEST_ptr(s = SSL_CONNECTION_FROM_SSL_ONLY(ssl))) {
TEST_info("Failed creating SSL");
goto err;
}
if (!TEST_ptr(s->enc_write_ctx))
goto err;
- s->s3.tmp.new_cipher = SSL_CIPHER_find(s, TLS13_AES_128_GCM_SHA256_BYTES);
+ s->s3.tmp.new_cipher = SSL_CIPHER_find(ssl, TLS13_AES_128_GCM_SHA256_BYTES);
if (!TEST_ptr(s->s3.tmp.new_cipher)) {
TEST_info("Failed to find cipher");
goto err;
OPENSSL_free(key);
OPENSSL_free(iv);
OPENSSL_free(seq);
- SSL_free(s);
+ SSL_free(ssl);
SSL_CTX_free(ctx);
return ret;
}