]> git.ipfire.org Git - thirdparty/openssl.git/blame - test/v3ext.c
Fix unit tests when no-bf configured
[thirdparty/openssl.git] / test / v3ext.c
CommitLineData
e417070c
RS
1/*
2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
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
8 */
9
10#include <stdio.h>
11#include <openssl/x509.h>
12#include <openssl/x509v3.h>
13#include <openssl/pem.h>
14#include <openssl/err.h>
15
16int main(int ac, char **av)
17{
18 X509 *x = NULL;
19 BIO *b = NULL;
20 long pathlen;
21 int ret = 1;
22
23 if (ac != 2) {
24 fprintf(stderr, "Usage error\n");
25 goto end;
26 }
27 b = BIO_new_file(av[1], "r");
28 if (b == NULL)
29 goto end;
30 x = PEM_read_bio_X509(b, NULL, NULL, NULL);
31 if (x == NULL)
32 goto end;
33 pathlen = X509_get_pathlen(x);
34 if (pathlen == 6)
35 ret = 0;
36
37end:
38 ERR_print_errors_fp(stderr);
39 BIO_free(b);
40 X509_free(x);
41 return ret;
42}