int testresult = 0;
STACK_OF(SSL_CIPHER) *ciphers;
const SSL_CIPHER *currcipher;
+ int err;
docorrupt = 0;
+ ERR_clear_error();
+
TEST_info("Starting #%d, %s", testidx, cipher_list[testidx]);
if (!TEST_true(create_ssl_ctx_pair(NULL, TLS_server_method(),
if (!TEST_int_lt(SSL_read(server, junk, sizeof(junk)), 0))
goto end;
- if (!TEST_int_eq(ERR_GET_REASON(ERR_peek_error()),
- SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC))
- goto end;
+ do {
+ err = ERR_get_error();
+
+ if (err == 0) {
+ TEST_error("Decryption failed or bad record MAC not seen");
+ goto end;
+ }
+ } while (ERR_GET_REASON(err) != SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC);
testresult = 1;
end: