_gnutls_strdatum_to_buf() will account for NULL input.
[gnutls.git] / src / common.h
blob2f705f1dd0a1b1a26f164e8eca0fb7aea315dafe
1 /*
2 * Copyright (C) 2000-2012 Free Software Foundation, Inc.
3 * Author: Nikos Mavrogiannopoulos
5 * This file is part of GnuTLS.
7 * GnuTLS is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
12 * GnuTLS is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #define SERVER "127.0.0.1"
23 #include <config.h>
24 #include <gnutls/gnutls.h>
26 #include <sys/socket.h>
27 #include <netdb.h>
28 #include <unistd.h>
29 #ifndef _WIN32
30 # include <netinet/in.h>
31 #endif
33 #include <signal.h>
34 #ifdef _WIN32
35 #include <io.h>
36 #include <winbase.h>
37 #undef OCSP_RESPONSE
38 #endif
40 #ifndef __attribute__
41 #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)
42 #define __attribute__(Spec) /* empty */
43 #endif
44 #endif
46 /* the number of elements in the priority structures.
48 #define PRI_MAX 16
50 extern const char str_unknown[];
52 int print_info (gnutls_session_t state, int verbose, int print_cert);
53 void print_cert_info (gnutls_session_t, int flag, int print_cert);
54 void print_cert_info_compact (gnutls_session_t session);
56 void print_list (const char* priorities, int verbose);
57 int cert_verify (gnutls_session_t session, const char* hostname);
59 const char *raw_to_string (const unsigned char *raw, size_t raw_size);
60 void pkcs11_common (void);
61 int check_command(gnutls_session_t session, const char* str);
63 int
64 pin_callback (void *user, int attempt, const char *token_url,
65 const char *token_label, unsigned int flags, char *pin,
66 size_t pin_max);
68 void pkcs11_common (void);