Lines Matching refs:fault
128 QTEST_FAULT **fault, BIO **tracebio) in qtest_create_quic_objects() argument
145 if (fault != NULL) { in qtest_create_quic_objects()
146 *fault = OPENSSL_zalloc(sizeof(**fault)); in qtest_create_quic_objects()
147 if (*fault == NULL) in qtest_create_quic_objects()
229 if (!TEST_ptr(fault)) in qtest_create_quic_objects()
262 (*fault)->noiseargs.cbio = cbio; in qtest_create_quic_objects()
263 (*fault)->noiseargs.sbio = sbio; in qtest_create_quic_objects()
264 (*fault)->noiseargs.tracebio = tmpbio; in qtest_create_quic_objects()
265 (*fault)->noiseargs.flags = flags; in qtest_create_quic_objects()
268 SSL_set_msg_callback_arg(*cssl, &(*fault)->noiseargs); in qtest_create_quic_objects()
284 BIO_set_data(fisbio, fault == NULL ? NULL : *fault); in qtest_create_quic_objects()
324 &(*fault)->noiseargs); in qtest_create_quic_objects()
326 if (fault != NULL) in qtest_create_quic_objects()
327 (*fault)->qtserv = *qtserv; in qtest_create_quic_objects()
341 if (fault != NULL) in qtest_create_quic_objects()
342 OPENSSL_free(*fault); in qtest_create_quic_objects()
696 void qtest_fault_free(QTEST_FAULT *fault) in qtest_fault_free() argument
698 if (fault == NULL) in qtest_fault_free()
701 packet_plain_finish(fault); in qtest_fault_free()
702 handshake_finish(fault); in qtest_fault_free()
704 OPENSSL_free(fault); in qtest_fault_free()
714 QTEST_FAULT *fault = arg; in packet_plain_mutate() local
724 fault->pplainio.buf_len = bufsz; in packet_plain_mutate()
729 fault->pplainio.buf = cur = OPENSSL_malloc(bufsz); in packet_plain_mutate()
731 fault->pplainio.buf_len = 0; in packet_plain_mutate()
735 fault->pplainbuf_alloc = bufsz; in packet_plain_mutate()
743 fault->pplainhdr = *hdrin; in packet_plain_mutate()
746 if (fault->pplaincb != NULL in packet_plain_mutate()
747 && !fault->pplaincb(fault, &fault->pplainhdr, in packet_plain_mutate()
748 (unsigned char *)fault->pplainio.buf, in packet_plain_mutate()
749 fault->pplainio.buf_len, fault->pplaincbarg)) in packet_plain_mutate()
752 *hdrout = &fault->pplainhdr; in packet_plain_mutate()
753 *iovecout = &fault->pplainio; in packet_plain_mutate()
761 QTEST_FAULT *fault = arg; in packet_plain_finish() local
764 OPENSSL_free((unsigned char *)fault->pplainio.buf); in packet_plain_finish()
765 fault->pplainio.buf_len = 0; in packet_plain_finish()
766 fault->pplainbuf_alloc = 0; in packet_plain_finish()
767 fault->pplainio.buf = NULL; in packet_plain_finish()
770 int qtest_fault_set_packet_plain_listener(QTEST_FAULT *fault, in qtest_fault_set_packet_plain_listener() argument
774 fault->pplaincb = pplaincb; in qtest_fault_set_packet_plain_listener()
775 fault->pplaincbarg = pplaincbarg; in qtest_fault_set_packet_plain_listener()
777 return ossl_quic_tserver_set_plain_packet_mutator(fault->qtserv, in qtest_fault_set_packet_plain_listener()
780 fault); in qtest_fault_set_packet_plain_listener()
784 int qtest_fault_resize_plain_packet(QTEST_FAULT *fault, size_t newlen) in qtest_fault_resize_plain_packet() argument
787 size_t oldlen = fault->pplainio.buf_len; in qtest_fault_resize_plain_packet()
793 if (fault->pplainbuf_alloc == 0) in qtest_fault_resize_plain_packet()
796 if (newlen > fault->pplainbuf_alloc) { in qtest_fault_resize_plain_packet()
802 buf = (unsigned char *)fault->pplainio.buf; in qtest_fault_resize_plain_packet()
809 fault->pplainio.buf_len = newlen; in qtest_fault_resize_plain_packet()
810 fault->pplainhdr.len = newlen; in qtest_fault_resize_plain_packet()
819 int qtest_fault_prepend_frame(QTEST_FAULT *fault, const unsigned char *frame, in qtest_fault_prepend_frame() argument
829 if (fault->pplainbuf_alloc == 0) in qtest_fault_prepend_frame()
833 buf = (unsigned char *)fault->pplainio.buf; in qtest_fault_prepend_frame()
834 old_len = fault->pplainio.buf_len; in qtest_fault_prepend_frame()
837 if (!TEST_true(qtest_fault_resize_plain_packet(fault, in qtest_fault_prepend_frame()
851 QTEST_FAULT *fault = arg; in handshake_mutate() local
861 fault->handbuf = buf; in handshake_mutate()
862 fault->handbuflen = msginlen; in handshake_mutate()
863 fault->handbufalloc = msginlen + GROWTH_ALLOWANCE; in handshake_mutate()
878 if (fault->encextcb == NULL) in handshake_mutate()
887 if (!fault->encextcb(fault, &ee, payloadlen, fault->encextcbarg)) in handshake_mutate()
896 if (fault->handshakecb != NULL in handshake_mutate()
897 && !fault->handshakecb(fault, buf, fault->handbuflen, in handshake_mutate()
898 fault->handshakecbarg)) in handshake_mutate()
902 *msgoutlen = fault->handbuflen; in handshake_mutate()
909 QTEST_FAULT *fault = arg; in handshake_finish() local
911 OPENSSL_free(fault->handbuf); in handshake_finish()
912 fault->handbuf = NULL; in handshake_finish()
915 int qtest_fault_set_handshake_listener(QTEST_FAULT *fault, in qtest_fault_set_handshake_listener() argument
919 fault->handshakecb = handshakecb; in qtest_fault_set_handshake_listener()
920 fault->handshakecbarg = handshakecbarg; in qtest_fault_set_handshake_listener()
922 return ossl_quic_tserver_set_handshake_mutator(fault->qtserv, in qtest_fault_set_handshake_listener()
925 fault); in qtest_fault_set_handshake_listener()
928 int qtest_fault_set_hand_enc_ext_listener(QTEST_FAULT *fault, in qtest_fault_set_hand_enc_ext_listener() argument
932 fault->encextcb = encextcb; in qtest_fault_set_hand_enc_ext_listener()
933 fault->encextcbarg = encextcbarg; in qtest_fault_set_hand_enc_ext_listener()
935 return ossl_quic_tserver_set_handshake_mutator(fault->qtserv, in qtest_fault_set_hand_enc_ext_listener()
938 fault); in qtest_fault_set_hand_enc_ext_listener()
942 int qtest_fault_resize_handshake(QTEST_FAULT *fault, size_t newlen) in qtest_fault_resize_handshake() argument
945 size_t oldlen = fault->handbuflen; in qtest_fault_resize_handshake()
951 if (fault->handbufalloc == 0) in qtest_fault_resize_handshake()
954 if (newlen > fault->handbufalloc) { in qtest_fault_resize_handshake()
959 buf = (unsigned char *)fault->handbuf; in qtest_fault_resize_handshake()
966 fault->handbuflen = newlen; in qtest_fault_resize_handshake()
971 int qtest_fault_resize_message(QTEST_FAULT *fault, size_t newlen) in qtest_fault_resize_message() argument
974 if (!qtest_fault_resize_handshake(fault, newlen + SSL3_HM_HEADER_LENGTH)) in qtest_fault_resize_message()
978 fault->handbuf[1] = (unsigned char)((newlen >> 16) & 0xff); in qtest_fault_resize_message()
979 fault->handbuf[2] = (unsigned char)((newlen >> 8) & 0xff); in qtest_fault_resize_message()
980 fault->handbuf[3] = (unsigned char)((newlen ) & 0xff); in qtest_fault_resize_message()
985 int qtest_fault_delete_extension(QTEST_FAULT *fault, in qtest_fault_delete_extension() argument
995 size_t msglen = fault->handbuflen; in qtest_fault_delete_extension()
1059 if (!qtest_fault_resize_message(fault, msglen)) in qtest_fault_delete_extension()
1075 QTEST_FAULT *fault; in pcipher_sendmmsg() local
1086 fault = BIO_get_data(b); in pcipher_sendmmsg()
1087 if (fault == NULL in pcipher_sendmmsg()
1088 || (fault->pciphercb == NULL && fault->datagramcb == NULL)) in pcipher_sendmmsg()
1097 fault->msg = BIO_MSG_N(msg, stride, i); in pcipher_sendmmsg()
1100 tmpdata = OPENSSL_malloc(fault->msg.data_len + GROWTH_ALLOWANCE); in pcipher_sendmmsg()
1103 memcpy(tmpdata, fault->msg.data, fault->msg.data_len); in pcipher_sendmmsg()
1104 fault->msg.data = tmpdata; in pcipher_sendmmsg()
1105 fault->msgalloc = fault->msg.data_len + GROWTH_ALLOWANCE; in pcipher_sendmmsg()
1107 if (fault->pciphercb != NULL) { in pcipher_sendmmsg()
1108 if (!PACKET_buf_init(&pkt, fault->msg.data, fault->msg.data_len)) in pcipher_sendmmsg()
1127 if (!fault->pciphercb(fault, &hdr, (unsigned char *)hdr.data, in pcipher_sendmmsg()
1128 hdr.len, fault->pciphercbarg)) in pcipher_sendmmsg()
1141 if (fault->datagramcb != NULL in pcipher_sendmmsg()
1142 && !fault->datagramcb(fault, &fault->msg, stride, in pcipher_sendmmsg()
1143 fault->datagramcbarg)) in pcipher_sendmmsg()
1146 if (!BIO_sendmmsg(next, &fault->msg, stride, 1, flags, &tmpnump)) { in pcipher_sendmmsg()
1151 OPENSSL_free(fault->msg.data); in pcipher_sendmmsg()
1152 fault->msg.data = NULL; in pcipher_sendmmsg()
1153 fault->msgalloc = 0; in pcipher_sendmmsg()
1159 OPENSSL_free(fault->msg.data); in pcipher_sendmmsg()
1160 fault->msg.data = NULL; in pcipher_sendmmsg()
1197 int qtest_fault_set_packet_cipher_listener(QTEST_FAULT *fault, in qtest_fault_set_packet_cipher_listener() argument
1201 fault->pciphercb = pciphercb; in qtest_fault_set_packet_cipher_listener()
1202 fault->pciphercbarg = pciphercbarg; in qtest_fault_set_packet_cipher_listener()
1207 int qtest_fault_set_datagram_listener(QTEST_FAULT *fault, in qtest_fault_set_datagram_listener() argument
1211 fault->datagramcb = datagramcb; in qtest_fault_set_datagram_listener()
1212 fault->datagramcbarg = datagramcbarg; in qtest_fault_set_datagram_listener()
1218 int qtest_fault_resize_datagram(QTEST_FAULT *fault, size_t newlen) in qtest_fault_resize_datagram() argument
1220 if (newlen > fault->msgalloc) in qtest_fault_resize_datagram()
1223 if (newlen > fault->msg.data_len) in qtest_fault_resize_datagram()
1224 memset((unsigned char *)fault->msg.data + fault->msg.data_len, 0, in qtest_fault_resize_datagram()
1225 newlen - fault->msg.data_len); in qtest_fault_resize_datagram()
1227 fault->msg.data_len = newlen; in qtest_fault_resize_datagram()
1232 int qtest_fault_set_bw_limit(QTEST_FAULT *fault, in qtest_fault_set_bw_limit() argument
1236 BIO *sbio = fault->noiseargs.sbio; in qtest_fault_set_bw_limit()
1237 BIO *cbio = fault->noiseargs.cbio; in qtest_fault_set_bw_limit()