tls_none.c 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. /*
  2. * SSL/TLS interface functions for no TLS case
  3. * Copyright (c) 2004-2009, Jouni Malinen <j@w1.fi>
  4. *
  5. * This software may be distributed under the terms of the BSD license.
  6. * See README for more details.
  7. */
  8. #include "includes.h"
  9. #include "common.h"
  10. #include "tls.h"
  11. void * tls_init(const struct tls_config *conf)
  12. {
  13. return (void *) 1;
  14. }
  15. void tls_deinit(void *ssl_ctx)
  16. {
  17. }
  18. int tls_get_errors(void *tls_ctx)
  19. {
  20. return 0;
  21. }
  22. struct tls_connection * tls_connection_init(void *tls_ctx)
  23. {
  24. return NULL;
  25. }
  26. void tls_connection_deinit(void *tls_ctx, struct tls_connection *conn)
  27. {
  28. }
  29. int tls_connection_established(void *tls_ctx, struct tls_connection *conn)
  30. {
  31. return -1;
  32. }
  33. int tls_connection_shutdown(void *tls_ctx, struct tls_connection *conn)
  34. {
  35. return -1;
  36. }
  37. int tls_connection_set_params(void *tls_ctx, struct tls_connection *conn,
  38. const struct tls_connection_params *params)
  39. {
  40. return -1;
  41. }
  42. int tls_global_set_params(void *tls_ctx,
  43. const struct tls_connection_params *params)
  44. {
  45. return -1;
  46. }
  47. int tls_global_set_verify(void *tls_ctx, int check_crl)
  48. {
  49. return -1;
  50. }
  51. int tls_connection_set_verify(void *tls_ctx, struct tls_connection *conn,
  52. int verify_peer, unsigned int flags,
  53. const u8 *session_ctx, size_t session_ctx_len)
  54. {
  55. return -1;
  56. }
  57. int tls_connection_get_random(void *tls_ctx, struct tls_connection *conn,
  58. struct tls_random *data)
  59. {
  60. return -1;
  61. }
  62. int tls_connection_export_key(void *tls_ctx, struct tls_connection *conn,
  63. const char *label, u8 *out, size_t out_len)
  64. {
  65. return -1;
  66. }
  67. int tls_connection_get_eap_fast_key(void *tls_ctx, struct tls_connection *conn,
  68. u8 *out, size_t out_len)
  69. {
  70. return -1;
  71. }
  72. struct wpabuf * tls_connection_handshake(void *tls_ctx,
  73. struct tls_connection *conn,
  74. const struct wpabuf *in_data,
  75. struct wpabuf **appl_data)
  76. {
  77. return NULL;
  78. }
  79. struct wpabuf * tls_connection_server_handshake(void *tls_ctx,
  80. struct tls_connection *conn,
  81. const struct wpabuf *in_data,
  82. struct wpabuf **appl_data)
  83. {
  84. return NULL;
  85. }
  86. struct wpabuf * tls_connection_encrypt(void *tls_ctx,
  87. struct tls_connection *conn,
  88. const struct wpabuf *in_data)
  89. {
  90. return NULL;
  91. }
  92. struct wpabuf * tls_connection_decrypt(void *tls_ctx,
  93. struct tls_connection *conn,
  94. const struct wpabuf *in_data)
  95. {
  96. return NULL;
  97. }
  98. int tls_connection_resumed(void *tls_ctx, struct tls_connection *conn)
  99. {
  100. return 0;
  101. }
  102. int tls_connection_set_cipher_list(void *tls_ctx, struct tls_connection *conn,
  103. u8 *ciphers)
  104. {
  105. return -1;
  106. }
  107. int tls_get_version(void *ssl_ctx, struct tls_connection *conn,
  108. char *buf, size_t buflen)
  109. {
  110. return -1;
  111. }
  112. int tls_get_cipher(void *tls_ctx, struct tls_connection *conn,
  113. char *buf, size_t buflen)
  114. {
  115. return -1;
  116. }
  117. int tls_connection_enable_workaround(void *tls_ctx,
  118. struct tls_connection *conn)
  119. {
  120. return -1;
  121. }
  122. int tls_connection_client_hello_ext(void *tls_ctx, struct tls_connection *conn,
  123. int ext_type, const u8 *data,
  124. size_t data_len)
  125. {
  126. return -1;
  127. }
  128. int tls_connection_get_failed(void *tls_ctx, struct tls_connection *conn)
  129. {
  130. return 0;
  131. }
  132. int tls_connection_get_read_alerts(void *tls_ctx, struct tls_connection *conn)
  133. {
  134. return 0;
  135. }
  136. int tls_connection_get_write_alerts(void *tls_ctx,
  137. struct tls_connection *conn)
  138. {
  139. return 0;
  140. }
  141. int tls_get_library_version(char *buf, size_t buf_len)
  142. {
  143. return os_snprintf(buf, buf_len, "none");
  144. }
  145. void tls_connection_set_success_data(struct tls_connection *conn,
  146. struct wpabuf *data)
  147. {
  148. }
  149. void tls_connection_set_success_data_resumed(struct tls_connection *conn)
  150. {
  151. }
  152. const struct wpabuf *
  153. tls_connection_get_success_data(struct tls_connection *conn)
  154. {
  155. return NULL;
  156. }
  157. void tls_connection_remove_session(struct tls_connection *conn)
  158. {
  159. }