2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL license (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 #include <openssl/opensslconf.h>
11 #include <openssl/bio.h>
12 #include <openssl/crypto.h>
13 #include <openssl/ssl.h>
16 int main(int argc, char *argv[])
23 err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT);
25 CRYPTO_set_mem_debug(1);
26 CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON);
28 /* Test tlsext_status_type */
29 ctx = SSL_CTX_new(TLS_method());
31 if (SSL_CTX_get_tlsext_status_type(ctx) != -1) {
32 printf("Unexpected initial value for "
33 "SSL_CTX_get_tlsext_status_type()\n");
39 if (SSL_get_tlsext_status_type(con) != -1) {
40 printf("Unexpected initial value for SSL_get_tlsext_status_type()\n");
44 if (!SSL_set_tlsext_status_type(con, TLSEXT_STATUSTYPE_ocsp)) {
45 printf("Unexpected fail for SSL_set_tlsext_status_type()\n");
49 if (SSL_get_tlsext_status_type(con) != TLSEXT_STATUSTYPE_ocsp) {
50 printf("Unexpected result for SSL_get_tlsext_status_type()\n");
57 if (!SSL_CTX_set_tlsext_status_type(ctx, TLSEXT_STATUSTYPE_ocsp)) {
58 printf("Unexpected fail for SSL_CTX_set_tlsext_status_type()\n");
62 if (SSL_CTX_get_tlsext_status_type(ctx) != TLSEXT_STATUSTYPE_ocsp) {
63 printf("Unexpected result for SSL_CTX_get_tlsext_status_type()\n");
69 if (SSL_get_tlsext_status_type(con) != TLSEXT_STATUSTYPE_ocsp) {
70 printf("Unexpected result for SSL_get_tlsext_status_type() (test 2)\n");
80 #ifndef OPENSSL_NO_CRYPTO_MDEBUG
81 if (CRYPTO_mem_leaks(err) <= 0)
89 return testresult?0:1;