This ensures that this function has functional tests.
Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
fprintf(stderr, "could not verify certificate: %.4x\n", status);
exit(1);
}
+
+ status = gnutls_ocsp_status_request_is_checked(client, 0);
+ if (status != 0) {
+ fprintf(stderr, "gnutls_ocsp_status_request_is_checked: unexpected value (%u)\n", status);
+ exit(1);
+ }
+
+ status = gnutls_ocsp_status_request_is_checked(client, GNUTLS_OCSP_SR_IS_AVAIL);
+ if (status != 0) {
+ fprintf(stderr, "gnutls_ocsp_status_request_is_checked: unexpected value (%u)\n", status);
+ exit(1);
+ }
+
+ status = gnutls_ocsp_status_request_is_checked(server, 0);
+ if (status != 0) {
+ fprintf(stderr, "gnutls_ocsp_status_request_is_checked: unexpected value (%u)\n", status);
+ exit(1);
+ }
}
gnutls_bye(client, GNUTLS_SHUT_RDWR);
if (resp.size != exp_resp->size || memcmp(resp.data, exp_resp->data, resp.size) != 0) {
fail("did not receive the expected response\n");
}
+
+ /* we provide a response, but an invalid one */
+ ret = gnutls_ocsp_status_request_is_checked(session, 0);
+ if (ret != 0) {
+ fail("did not receive the expected value (%d)\n", ret);
+ }
+
+ ret = gnutls_ocsp_status_request_is_checked(session, GNUTLS_OCSP_SR_IS_AVAIL);
+ if (ret == 0) {
+ fail("did not receive the expected value (%d)\n", ret);
+ }
}
void doit(void)
fail("did not receive the expected intermediate response\n");
}
}
+
+ ret = gnutls_ocsp_status_request_is_checked(session, 0);
+ if (ret == 0) {
+ fail("did not receive the expected value (%d)\n", ret);
+ }
+
+ ret = gnutls_ocsp_status_request_is_checked(session, GNUTLS_OCSP_SR_IS_AVAIL);
+ if (ret == 0) {
+ fail("did not receive the expected value (%d)\n", ret);
+ }
}
static void tls_log_func(int level, const char *str)