2
* Lasso library C unit tests
4
* Copyright (C) 2006 Entr'ouvert
5
* http://lasso.entrouvert.org
7
* Authors: See AUTHORS file in top-level directory.
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
12
* (at your option) any later version.
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29
#include <lasso/lasso.h>
30
#include <lasso/id-ff/provider.h>
32
START_TEST(test01_metadata_load_der_certificate_from_x509_cert)
34
LassoProvider *provider = lasso_provider_new(LASSO_PROVIDER_ROLE_SP,
35
TESTSMETADATADIR "/metadata_01.xml", NULL, NULL);
36
fail_unless(provider != NULL, "Can't load DER certificate from <ds:X509Certificate>");
40
START_TEST(test02_metadata_load_pem_certificate_from_x509_cert)
42
LassoProvider *provider = lasso_provider_new(LASSO_PROVIDER_ROLE_SP,
43
TESTSMETADATADIR "/metadata_02.xml", NULL, NULL);
44
fail_unless(provider != NULL, "Can't load PEM certificate from <ds:X509Certificate>");
48
START_TEST(test03_metadata_load_der_public_key_from_keyvalue)
50
LassoProvider *provider = lasso_provider_new(LASSO_PROVIDER_ROLE_SP,
51
TESTSMETADATADIR "/metadata_03.xml", NULL, NULL);
52
fail_unless(provider != NULL, "Can't load DER public key from <ds:KeyValue>");
56
START_TEST(test04_metadata_load_pem_public_key_from_keyvalue)
58
LassoProvider *provider = lasso_provider_new(LASSO_PROVIDER_ROLE_SP,
59
TESTSMETADATADIR "/metadata_04.xml", NULL, NULL);
60
fail_unless(provider != NULL, "Can't load PEM public key from <ds:KeyValue>");
64
START_TEST(test05_metadata_load_public_key_from_x509_cert)
66
LassoProvider *provider = lasso_provider_new(LASSO_PROVIDER_ROLE_SP,
67
TESTSMETADATADIR "/metadata_05.xml", NULL, NULL);
68
fail_unless(provider != NULL, "Can't load DER public key from <ds:X509Certificate>");
76
Suite *s = suite_create("Metadata");
77
TCase *tc_metadata_load_der_certificate_from_x509_cert =
78
tcase_create("Load DER certificate from metadata");
79
TCase *tc_metadata_load_pem_certificate_from_x509_cert =
80
tcase_create("Load PEM certificate from metadata");
81
TCase *tc_metadata_load_der_public_key_from_keyvalue =
82
tcase_create("Load DER public key from <ds:KeyValue>");
83
TCase *tc_metadata_load_pem_public_key_from_keyvalue =
84
tcase_create("Load PEM public key from <ds:KeyValue>");
85
TCase *tc_metadata_load_public_key_from_x509_cert =
86
tcase_create("Load DER public key from <ds:X509Certificate>");
87
suite_add_tcase(s, tc_metadata_load_der_certificate_from_x509_cert);
88
suite_add_tcase(s, tc_metadata_load_pem_certificate_from_x509_cert);
89
suite_add_tcase(s, tc_metadata_load_der_public_key_from_keyvalue);
90
suite_add_tcase(s, tc_metadata_load_pem_public_key_from_keyvalue);
91
suite_add_tcase(s, tc_metadata_load_public_key_from_x509_cert);
92
tcase_add_test(tc_metadata_load_der_certificate_from_x509_cert,
93
test01_metadata_load_der_certificate_from_x509_cert);
94
tcase_add_test(tc_metadata_load_pem_certificate_from_x509_cert,
95
test02_metadata_load_pem_certificate_from_x509_cert);
96
tcase_add_test(tc_metadata_load_der_public_key_from_keyvalue,
97
test03_metadata_load_der_public_key_from_keyvalue);
98
tcase_add_test(tc_metadata_load_pem_public_key_from_keyvalue,
99
test04_metadata_load_pem_public_key_from_keyvalue);
100
tcase_add_test(tc_metadata_load_public_key_from_x509_cert,
101
test05_metadata_load_public_key_from_x509_cert);