remove @EAP_LDFLAGS@, no longer exists
[mech_eap.orig] / libeap / tests / test-x509.c
1 /*
2  * Testing tool for X.509v3 routines
3  * Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #include "includes.h"
16
17 #include "common.h"
18 #include "tls/x509v3.h"
19
20 extern int wpa_debug_level;
21
22
23 int main(int argc, char *argv[])
24 {
25         FILE *f;
26         u8 buf[3000];
27         size_t len;
28         struct x509_certificate *cert;
29
30         wpa_debug_level = 0;
31
32         f = fopen(argv[1], "rb");
33         if (f == NULL)
34                 return -1;
35         len = fread(buf, 1, sizeof(buf), f);
36         fclose(f);
37
38         cert = x509_certificate_parse(buf, len);
39         if (cert == NULL)
40                 printf("Failed to parse X.509 certificate\n");
41         x509_certificate_free(cert);
42
43         return 0;
44 }