2 * Copyright (C) 2004-2012 Free Software Foundation, Inc.
4 * Author: Simon Josefsson
6 * This file is part of GnuTLS.
8 * GnuTLS is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
13 * GnuTLS is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with GnuTLS; if not, write to the Free Software Foundation,
20 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
34 printf("GnuTLS header version %s.\n", GNUTLS_VERSION);
35 printf("GnuTLS library version %s.\n",
36 gnutls_check_version(NULL));
39 if (!gnutls_check_version(GNUTLS_VERSION))
40 fail("gnutls_check_version ERROR\n");
43 const gnutls_pk_algorithm_t *algs;
47 algs = gnutls_pk_list();
49 fail("gnutls_pk_list return NULL\n");
51 for (i = 0; algs[i]; i++) {
53 printf("pk_list[%d] = %d = %s = %d\n",
55 gnutls_pk_algorithm_get_name(algs
58 (gnutls_pk_algorithm_get_name
61 (gnutls_pk_algorithm_get_name(algs[i]))
63 fail("gnutls_pk id's doesn't match\n");
66 pk = gnutls_pk_get_id("foo");
67 if (pk != GNUTLS_PK_UNKNOWN)
68 fail("gnutls_pk unknown test failed (%d)\n", pk);
71 success("gnutls_pk_list ok\n");
75 const gnutls_sign_algorithm_t *algs;
79 algs = gnutls_sign_list();
81 fail("gnutls_sign_list return NULL\n");
83 for (i = 0; algs[i]; i++) {
85 printf("sign_list[%d] = %d = %s = %d\n",
87 gnutls_sign_algorithm_get_name(algs
90 (gnutls_sign_algorithm_get_name
92 if (gnutls_sign_get_id
93 (gnutls_sign_algorithm_get_name(algs[i])) !=
95 fail("gnutls_sign id's doesn't match\n");
98 pk = gnutls_sign_get_id("foo");
99 if (pk != GNUTLS_PK_UNKNOWN)
100 fail("gnutls_sign unknown test failed (%d)\n", pk);
103 success("gnutls_sign_list ok\n");