You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tls.h 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. #ifndef OS_TLS_H
  19. #define OS_TLS_H
  20. #ifdef HAVE_CONFIG_H
  21. #include <config.h>
  22. #endif
  23. #if defined(HAVE_GNUTLS)
  24. #include <gnutls/gnutls.h>
  25. #ifndef HAVE_GNUTLS_DATUM_T
  26. typedef gnutls_datum gnutls_datum_t;
  27. #endif
  28. #ifndef HAVE_GNUTLS_X509_CRT_T
  29. typedef gnutls_x509_crt gnutls_x509_crt_t;
  30. #endif
  31. #ifndef HAVE_GNUTLS_PK_ALGORITHM_T
  32. typedef gnutls_pk_algorithm gnutls_pk_algorithm_t;
  33. #endif
  34. #ifndef HAVE_GNUTLS_SIGN_ALGORITHM_T
  35. typedef gnutls_sign_algorithm gnutls_sign_algorithm_t;
  36. #endif
  37. #ifndef HAVE_GNUTLS_X509_CRT_PRINT
  38. typedef enum {
  39. GNUTLS_CRT_PRINT_ONELINE = 1
  40. } gnutls_certificate_print_formats_t;
  41. /*
  42. * Prints certificate in human-readable form.
  43. */
  44. int
  45. gnutls_x509_crt_print(gnutls_x509_crt_t cert,
  46. gnutls_certificate_print_formats_t format,
  47. gnutls_datum_t * out);
  48. #endif /* HAVE_GNUTLS_X509_CRT_PRINT */
  49. #endif /* HAVE_GNUTLS */
  50. #endif /* OS_TLS_H */