Adam Tkac | 68481c1 | 2011-02-09 14:15:09 +0000 | [diff] [blame] | 1 | /* Copyright (C) 2011 TightVNC Team. All Rights Reserved. |
| 2 | * |
| 3 | * This is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This software is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with this software; if not, write to the Free Software |
| 15 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
| 16 | * USA. |
| 17 | */ |
| 18 | |
| 19 | #ifndef OS_TLS_H |
| 20 | #define OS_TLS_H |
| 21 | |
| 22 | #ifdef HAVE_CONFIG_H |
| 23 | #include <config.h> |
| 24 | #endif |
| 25 | |
Adam Tkac | d007ece | 2011-02-09 16:06:16 +0000 | [diff] [blame^] | 26 | /* |
| 27 | * Windows builds are build against fairly new GNUTLS, ignore compatibility |
| 28 | * code. |
| 29 | */ |
| 30 | #if defined(HAVE_GNUTLS) && !defined(WIN32) |
Adam Tkac | 68481c1 | 2011-02-09 14:15:09 +0000 | [diff] [blame] | 31 | #include <gnutls/gnutls.h> |
| 32 | |
Adam Tkac | b486423 | 2011-02-09 15:38:37 +0000 | [diff] [blame] | 33 | #ifndef HAVE_GNUTLS_DATUM_T |
| 34 | typedef gnutls_datum gnutls_datum_t; |
| 35 | #endif |
| 36 | #ifndef HAVE_GNUTLS_CRT_T |
| 37 | typedef gnutls_x509_crt gnutls_x509_crt_t; |
| 38 | #endif |
| 39 | #ifndef HAVE_GNUTLS_PK_ALGORITHM_T |
| 40 | typedef gnutls_pk_algorithm gnutls_pk_algorithm_t; |
| 41 | #endif |
| 42 | #ifndef HAVE_GNUTLS_SIGN_ALGORITHM_T |
| 43 | typedef gnutls_sign_algorithm gnutls_sign_algorithm_t; |
| 44 | #endif |
| 45 | |
Adam Tkac | 68481c1 | 2011-02-09 14:15:09 +0000 | [diff] [blame] | 46 | #ifndef HAVE_GNUTLS_X509_CRT_PRINT |
Adam Tkac | 68481c1 | 2011-02-09 14:15:09 +0000 | [diff] [blame] | 47 | |
| 48 | typedef enum { |
| 49 | GNUTLS_CRT_PRINT_ONELINE = 1 |
| 50 | } gnutls_certificate_print_formats_t; |
| 51 | |
| 52 | /* |
| 53 | * Prints certificate in human-readable form. |
| 54 | */ |
| 55 | int |
| 56 | gnutls_x509_crt_print(gnutls_x509_crt_t cert, |
| 57 | gnutls_certificate_print_formats_t format, |
| 58 | gnutls_datum_t * out); |
| 59 | #endif /* HAVE_GNUTLS_X509_CRT_PRINT */ |
| 60 | #endif /* HAVE_GNUTLS */ |
| 61 | |
| 62 | #endif /* OS_TLS_H */ |
| 63 | |