bio_dgram_cases[idx].local);
}
+# if !defined(OPENSSL_NO_CHACHA)
static int random_data(const uint32_t *key, uint8_t *data, size_t data_len, size_t offset)
{
int ret = 0, outl;
BIO_ADDR_free(addr4);
return testresult;
}
-
+# endif /* !defined(OPENSSL_NO_CHACHA) */
#endif /* !defined(OPENSSL_NO_DGRAM) && !defined(OPENSSL_NO_SOCK) */
int setup_tests(void)
#if !defined(OPENSSL_NO_DGRAM) && !defined(OPENSSL_NO_SOCK)
ADD_ALL_TESTS(test_bio_dgram, OSSL_NELEM(bio_dgram_cases));
+# if !defined(OPENSSL_NO_CHACHA)
ADD_TEST(test_bio_dgram_pair);
+# endif
#endif
return 1;
};
/* 2. RFC 9001 - A.5 ChaCha20-Poly1305 Short Header Packet */
+#ifndef OPENSSL_NO_CHACHA
static const unsigned char rx_script_2_in[] = {
0x4c, 0xfe, 0x41, 0x89, 0x65, 0x5e, 0x5c, 0xd5, 0x5c, 0x41, 0xf6, 0x90,
0x80, 0x57, 0x5d, 0x79, 0x99, 0xc2, 0x5a, 0x5b, 0xfb
RX_OP_CHECK_NO_PKT()
RX_OP_END
};
+#endif /* !defined(OPENSSL_NO_CHACHA) */
/* 3. Real World - Version Negotiation Response */
static const unsigned char rx_script_3_in[] = {
* 7. Real World - S2C Multiple Packets
* - Initial, Handshake, 1-RTT (ChaCha20-Poly1305)
*/
+#ifndef OPENSSL_NO_CHACHA
static const QUIC_CONN_ID rx_script_7_c2s_init_dcid = {
4, {0xfa, 0x5d, 0xd6, 0x80}
};
RX_OP_END
};
+#endif /* !defined(OPENSSL_NO_CHACHA) */
/*
* 8. Real World - S2C Multiple Packets with Peer Initiated Key Phase Update
static const struct rx_test_op *rx_scripts[] = {
rx_script_1,
+#ifndef OPENSSL_NO_CHACHA
rx_script_2,
+#endif
rx_script_3,
rx_script_4,
rx_script_5,
rx_script_6,
+#ifndef OPENSSL_NO_CHACHA
rx_script_7,
+#endif
rx_script_8
};
hpr_key_len = 32;
break;
case 2:
+ /*
+ * In a build without CHACHA, we rerun the AES 256 tests.
+ * Removing all dependence on CHACHA is more difficult and these
+ * tests are fast enough.
+ */
+#ifndef OPENSSL_NO_CHACHA
hpr_cipher_id = QUIC_HDR_PROT_CIPHER_CHACHA;
+#else
+ hpr_cipher_id = QUIC_HDR_PROT_CIPHER_AES_256;
+#endif
hpr_key_len = 32;
break;
default:
*/
for (cipher = 0; cipher < HPR_CIPHER_COUNT; ++cipher)
for (i = 0; i < OSSL_NELEM(counts_u[0]); ++i) {
- if (!TEST_true(counts_u[cipher][i]))
+ if (!TEST_uint_gt(counts_u[cipher][i], 0))
goto err;
- if (!TEST_true(counts_c[cipher][i]))
+ if (!TEST_uint_gt(counts_c[cipher][i], 0))
goto err;
}
TX_OP_END
};
+#ifndef OPENSSL_NO_CHACHA
/* 3. RFC 9001 - A.5 ChaCha20-Poly1305 Short Header Packet */
static const unsigned char tx_script_3_body[] = {
0x01
TX_OP_WRITE_CHECK(3)
TX_OP_END
};
+#endif /* !defined(OPENSSL_NO_CHACHA) */
/* 4. Real World - AES-128-GCM Key Update */
static const unsigned char tx_script_4_secret[] = {
static const struct tx_test_op *const tx_scripts[] = {
tx_script_1,
tx_script_2,
+#ifndef OPENSSL_NO_CHACHA
tx_script_3,
+#endif
tx_script_4,
tx_script_5,
tx_script_6