dbus: Add debug printing on property setter type mismatches
[hostap-gosc2009.git] / tests / test-x509.c
blob96181c24cccd08d9194e21941d833c59b74f701f
1 /*
2 * Testing tool for X.509v3 routines
3 * Copyright (c) 2006-2009, Jouni Malinen <j@w1.fi>
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.
9 * Alternatively, this software may be distributed under the terms of BSD
10 * license.
12 * See README and COPYING for more details.
15 #include "includes.h"
17 #include "common.h"
18 #include "tls/x509v3.h"
20 extern int wpa_debug_level;
23 int main(int argc, char *argv[])
25 FILE *f;
26 u8 buf[3000];
27 size_t len;
28 struct x509_certificate *cert;
30 wpa_debug_level = 0;
32 f = fopen(argv[1], "rb");
33 if (f == NULL)
34 return -1;
35 len = fread(buf, 1, sizeof(buf), f);
36 fclose(f);
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);
43 return 0;