summaryrefslogtreecommitdiff
path: root/test/sslcorrupttest.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-11-18 23:44:09 +0000
committerMatt Caswell <matt@openssl.org>2016-12-05 17:05:40 +0000
commite60ce9c4513c432705c84b0efebf1421ee769eee (patch)
treecd5db5bc9752a54cb99d4e47e5a758149af16536 /test/sslcorrupttest.c
parent6a149cee78dd65dea7c8b3a36cb479f79ec2b3a3 (diff)
downloadopenssl-new-e60ce9c4513c432705c84b0efebf1421ee769eee.tar.gz
Update the record layer to use TLSv1.3 style record construction
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/sslcorrupttest.c')
-rw-r--r--test/sslcorrupttest.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/sslcorrupttest.c b/test/sslcorrupttest.c
index f07cfceda7..c1f074b11d 100644
--- a/test/sslcorrupttest.c
+++ b/test/sslcorrupttest.c
@@ -11,6 +11,8 @@
#include "ssltestlib.h"
#include "testutil.h"
+static int docorrupt = 0;
+
static void copy_flags(BIO *bio)
{
int flags;
@@ -38,7 +40,7 @@ static int tls_corrupt_write(BIO *bio, const char *in, int inl)
BIO *next = BIO_next(bio);
char *copy;
- if (in[0] == SSL3_RT_APPLICATION_DATA) {
+ if (docorrupt) {
copy = BUF_memdup(in, inl);
TEST_check(copy != NULL);
/* corrupt last bit of application data */
@@ -186,6 +188,8 @@ static int test_ssl_corrupt(int testidx)
STACK_OF(SSL_CIPHER) *ciphers;
const SSL_CIPHER *currcipher;
+ docorrupt = 0;
+
printf("Starting Test %d, %s\n", testidx, cipher_list[testidx]);
if (!create_ssl_ctx_pair(TLS_server_method(), TLS_client_method(), &sctx,
@@ -242,6 +246,8 @@ static int test_ssl_corrupt(int testidx)
goto end;
}
+ docorrupt = 1;
+
if (SSL_write(client, junk, sizeof(junk)) < 0) {
printf("Unable to SSL_write\n");
ERR_print_errors_fp(stdout);