} PACKET;
/*
- * Returns 1 if there are exactly |len| bytes left to be read from |pkt|
- * and 0 otherwise
+ * Returns the number of bytes remaining to be read in the PACKET
*/
__owur static inline size_t PACKET_remaining(PACKET *pkt)
{
memset(s->s3->client_random, 0, SSL3_RANDOM_SIZE);
if (!PACKET_peek_copy_bytes(&pkt, s->s3->client_random, i)
|| !PACKET_forward(&pkt, cl)
- || !PACKET_remaining(&pkt) == 0) {
+ || PACKET_remaining(&pkt) != 0) {
SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_RECORD_LENGTH_MISMATCH);
al = SSL_AD_DECODE_ERROR;
goto f_err;
}
}
/* We shouldn't have any bytes left */
- if (PACKET_remaining(&ssubpkt))
+ if (PACKET_remaining(&ssubpkt) != 0)
goto err;
}
|| (dsize & 1) != 0
|| (dsize == 0)
|| !PACKET_get_bytes(&subpkt, &data, dsize)
- || PACKET_remaining(&subpkt)
+ || PACKET_remaining(&subpkt) != 0
|| !tls1_save_sigalgs(s, data, dsize)) {
goto err;
}
|| !PACKET_forward(pkt, BUF_LEN - 1)
|| PACKET_remaining(pkt) != 1
|| !PACKET_forward(pkt, 1)
- || PACKET_remaining(pkt)) {
+ || PACKET_remaining(pkt) != 0) {
fprintf(stderr, "test_PACKET_remaining() failed\n");
return 0;
}