Branch Coverage

inc/matrixssl-3-9-3-open/matrixssl/extDecode.c
Criterion Covered Total %
branch 77 320 24.0


line true false branch
85 1149 0 if (c != end)
87 0 1149 if (end - c < 2)
96 1149 0 if ((uint32) (end - c) != extLen || extLen < 4)
0 1149 if ((uint32) (end - c) != extLen || extLen < 4)
106 4601 1149 while (c != end)
110 0 4601 if (end - c < 2)
119 0 4601 if ((uint32) (end - c) < extLen)
126 7 4594 if (extType == EXT_RENEGOTIATION_INFO)
132 0 4601 if ((rc = ClientHelloExt(ssl, extType, extLen, c)) < 0)
142 0 1149 if (ssl->extFlags.require_extended_master_secret == 1 &&
0 0 if (ssl->extFlags.require_extended_master_secret == 1 &&
151 1149 0 if (ssl->flags & SSL_FLAGS_TLS_1_2)
153 0 1149 if (!ssl->hashSigAlg)
180 0 1149 if (ssl->extFlags.session_id == 1)
190 1142 7 if (!renegotiationExtSent)
194 0 1142 if (ssl->secureRenegotiationFlag == PS_FALSE &&
0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
202 1142 0 if (ssl->secureRenegotiationFlag == PS_TRUE &&
0 1142 if (ssl->secureRenegotiationFlag == PS_TRUE &&
210 0 1142 if (ssl->secureRenegotiationFlag == PS_FALSE &&
0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
250 0 0 if (extLen != 0)
257 0 0 if (!ssl->extFlags.deny_truncated_hmac)
264 0 1149 if (extLen != 0)
276 0 0 if (extLen != 1)
284 0 0 if (!ssl->extFlags.deny_max_fragment_len)
286 0 0 if (*c == 0x1)
290 0 0 else if (*c == 0x2)
294 0 0 else if (*c == 0x3)
298 0 0 else if (*c == 0x4)
315 0 0 if (extLen < 5)
326 0 0 if (*c++ != 0x0)
338 0 0 if ((int32) extLen < i || i > 255 || i <= 0)
0 0 if ((int32) extLen < i || i > 255 || i <= 0)
0 0 if ((int32) extLen < i || i > 255 || i <= 0)
344 0 0 if (ssl->expectedName)
348 0 0 if ((ssl->expectedName = psMalloc(ssl->sPool, i + 1)) == NULL)
362 0 0 if (extLen < 2)
369 0 0 if (ssl->srv_alpn_cb)
372 0 0 if ((rc = dealWithAlpnExt(ssl, c, extLen)) < 0)
374 0 0 if (rc == PS_PROTOCOL_FAIL)
393 0 7 if (ssl->secureRenegotiationFlag == PS_FALSE &&
0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
396 0 0 if (extLen == 1 && *c == '\0')
0 0 if (extLen == 1 && *c == '\0')
407 7 0 else if ((extLen == ssl->peerVerifyDataLen + 1) &&
7 0 else if ((extLen == ssl->peerVerifyDataLen + 1) &&
410 0 7 if (*c != ssl->peerVerifyDataLen)
416 0 7 if (memcmpct(c + 1, ssl->peerVerifyData,
444 1149 0 if (extLen > (2 + 32) || extLen < 4 || (extLen & 1))
1149 0 if (extLen > (2 + 32) || extLen < 4 || (extLen & 1))
0 1149 if (extLen > (2 + 32) || extLen < 4 || (extLen & 1))
455 1149 0 if ((uint32) tmpLen > extLen || tmpLen < 2 || (tmpLen & 1))
1149 0 if ((uint32) tmpLen > extLen || tmpLen < 2 || (tmpLen & 1))
0 1149 if ((uint32) tmpLen > extLen || tmpLen < 2 || (tmpLen & 1))
466 9192 1149 while (tmpLen >= 2 && extLen >= 2)
9192 0 while (tmpLen >= 2 && extLen >= 2)
483 0 0 if (ssl->sid == NULL)
489 0 0 if (ssl->sid == NULL)
497 0 0 if (extLen > 0) /* received a ticket */
501 0 0 if (matrixUnlockSessionTicket(ssl, (unsigned char *) c, extLen) ==
517 0 0 if (ssl->sessionIdLen > 0)
523 0 0 if (ssl->keys && ssl->keys->sessTickets)
0 0 if (ssl->keys && ssl->keys->sessTickets)
539 0 0 if (ssl->keys && ssl->keys->sessTickets)
0 0 if (ssl->keys && ssl->keys->sessTickets)
556 0 1148 if (extLen < 4)
565 1148 0 if (dataLen > extLen || dataLen < 2 || (dataLen & 1))
1148 0 if (dataLen > extLen || dataLen < 2 || (dataLen & 1))
0 1148 if (dataLen > extLen || dataLen < 2 || (dataLen & 1))
574 5740 1148 while (dataLen >= 2 && extLen >= 2)
5740 0 while (dataLen >= 2 && extLen >= 2)
584 5740 0 if (psTestUserEcID(curveId, ssl->ecInfo.ecFlags) == 0)
593 1148 4592 if (ecFlags == IS_RECVD_EXT)
606 0 1148 if (extLen < 1)
614 1148 0 if (dataLen > extLen || dataLen < 1)
0 1148 if (dataLen > extLen || dataLen < 1)
622 0 1148 if (memchr(c, '\0', dataLen) == NULL)
634 0 0 if (extLen < 5 || *c != 0x1)
0 0 if (extLen < 5 || *c != 0x1)
644 0 0 if (dataLen + 2 > extLen)
654 0 0 if (dataLen > extLen)
664 0 0 if (ssl->keys->OCSPResponseBufLen > 0 &&
0 0 if (ssl->keys->OCSPResponseBufLen > 0 &&
685 0 0 if (ssl->keys->SCTResponseBufLen > 0 &&
0 0 if (ssl->keys->SCTResponseBufLen > 0 &&
721 0 0 if (totLen != extLen - 2)
726 0 0 for (i = 0; totLen > 0; i++)
728 0 0 if (i + 1 > MAX_PROTO_EXT)
734 0 0 if (protoLen[i] > totLen)
736 0 0 while (i > 0)
743 0 0 if ((proto[i] = psMalloc(ssl->sPool, protoLen[i])) == NULL)
745 0 0 while (i > 0)
763 0 0 if (userChoice == MAX_PROTO_EXT)
766 0 0 while (i > 0)
773 0 0 if (userChoice >= i)
776 0 0 while (i > 0)
784 0 0 if (userChoice < 0)
788 0 0 while (i > 0)
801 0 0 while (i > 0)
803 0 0 if (i - 1 != userChoice)
814 0 0 if ((ssl->alpnLen == 2) && (memcmp(ssl->alpn, "h2", 2) == 0))
0 0 if ((ssl->alpnLen == 2) && (memcmp(ssl->alpn, "h2", 2) == 0))
846 0 1150 if (end - c < 2)
854 0 1150 if ((uint32) (end - c) < extLen)
860 3449 1150 while ((int32) hsLen > (c - extData))
864 0 3449 if (end - c < 2)
872 0 3449 if ((uint32) (end - c) < extLen)
879 1150 2299 if (extType == EXT_RENEGOTIATION_INFO)
884 0 3449 if ((rc = ServerHelloExt(ssl, extType, extLen, c)) < 0)
895 0 1150 if (ssl->extFlags.req_extended_master_secret == 1)
899 0 0 if (ssl->extFlags.require_extended_master_secret == 1)
908 0 1150 if (ssl->extFlags.req_status_request == 1)
910 0 0 if (ssl->extFlags.status_request == 0)
920 0 1150 if (!renegotiationExtSent)
924 0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
932 0 0 if (ssl->secureRenegotiationFlag == PS_TRUE &&
0 0 if (ssl->secureRenegotiationFlag == PS_TRUE &&
940 0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
0 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
973 0 0 if (ssl->extFlags.req_sni)
976 0 0 if (ssl->extCb)
990 0 0 if (ssl->extFlags.req_max_fragment_len)
995 0 0 if (!(ssl->maxPtFrag & 0x10000))
1001 0 0 if (extLen != 1)
1009 0 0 if (*c == 0x01 &&
0 0 if (*c == 0x01 &&
1014 0 0 else if (*c == 0x02 &&
0 0 else if (*c == 0x02 &&
1019 0 0 else if (*c == 0x03 &&
0 0 else if (*c == 0x03 &&
1024 0 0 else if (*c == 0x04 &&
0 0 else if (*c == 0x04 &&
1041 0 0 if (ssl->extFlags.req_truncated_hmac)
1046 0 0 if (extLen != 0)
1056 1150 0 if (ssl->extFlags.req_extended_master_secret)
1061 0 1150 if (extLen != 0)
1080 1149 0 if (ssl->extFlags.req_elliptic_points)
1085 0 1149 if (*c++ != (extLen - 1))
1104 0 0 if (ssl->extFlags.req_alpn)
1107 0 0 if (ssl->extCb)
1122 0 0 if (ssl->extFlags.req_session_ticket)
1127 0 0 if (ssl->sid && ssl->sid->sessionTicketState ==
0 0 if (ssl->sid && ssl->sid->sessionTicketState ==
1133 0 0 else if (ssl->sid && ssl->sid->sessionTicketState ==
0 0 else if (ssl->sid && ssl->sid->sessionTicketState ==
1152 1150 0 if (ssl->extFlags.req_renegotiation_info)
1157 1143 7 if (ssl->secureRenegotiationFlag == PS_FALSE &&
1143 0 if (ssl->secureRenegotiationFlag == PS_FALSE &&
1160 1143 0 if (extLen == 1 && *c == '\0')
1143 0 if (extLen == 1 && *c == '\0')
1171 7 0 else if (ssl->secureRenegotiationFlag == PS_TRUE &&
7 0 else if (ssl->secureRenegotiationFlag == PS_TRUE &&
1175 0 7 if (memcmpct(c, ssl->myVerifyData,
1182 0 7 if (memcmpct(c + ssl->myVerifyDataLen, ssl->peerVerifyData,
1200 0 0 if (ssl->extFlags.req_status_request)
1213 0 0 if (ssl->extCb)
1220 0 3449 if (rc < 0)
1222 0 0 if (ssl->minVer >= TLS_1_2_MIN_VER)