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
36 printf ("GnuTLS header version %s.\n", GNUTLS_VERSION
);
37 printf ("GnuTLS library version %s.\n", gnutls_check_version (NULL
));
40 if (!gnutls_check_version (GNUTLS_VERSION
))
41 fail ("gnutls_check_version ERROR\n");
44 const gnutls_pk_algorithm_t
*algs
;
48 algs
= gnutls_pk_list ();
50 fail ("gnutls_pk_list return NULL\n");
52 for (i
= 0; algs
[i
]; i
++)
55 printf ("pk_list[%d] = %d = %s = %d\n", (int) i
, algs
[i
],
56 gnutls_pk_algorithm_get_name (algs
[i
]),
57 gnutls_pk_get_id (gnutls_pk_algorithm_get_name (algs
[i
])));
58 if (gnutls_pk_get_id (gnutls_pk_algorithm_get_name (algs
[i
]))
60 fail ("gnutls_pk id's doesn't match\n");
63 pk
= gnutls_pk_get_id ("foo");
64 if (pk
!= GNUTLS_PK_UNKNOWN
)
65 fail ("gnutls_pk unknown test failed (%d)\n", pk
);
68 success ("gnutls_pk_list ok\n");
72 const gnutls_sign_algorithm_t
*algs
;
76 algs
= gnutls_sign_list ();
78 fail ("gnutls_sign_list return NULL\n");
80 for (i
= 0; algs
[i
]; i
++)
83 printf ("sign_list[%d] = %d = %s = %d\n", (int) i
, algs
[i
],
84 gnutls_sign_algorithm_get_name (algs
[i
]),
85 gnutls_sign_get_id (gnutls_sign_algorithm_get_name
87 if (gnutls_sign_get_id (gnutls_sign_algorithm_get_name (algs
[i
])) !=
89 fail ("gnutls_sign id's doesn't match\n");
92 pk
= gnutls_sign_get_id ("foo");
93 if (pk
!= GNUTLS_PK_UNKNOWN
)
94 fail ("gnutls_sign unknown test failed (%d)\n", pk
);
97 success ("gnutls_sign_list ok\n");