eap_register.c 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  1. /*
  2. * EAP method registration
  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 "eap_peer/eap_methods.h"
  11. #include "eap_server/eap_methods.h"
  12. #include "wpa_supplicant_i.h"
  13. /**
  14. * eap_register_methods - Register statically linked EAP methods
  15. * Returns: 0 on success, -1 or -2 on failure
  16. *
  17. * This function is called at program initialization to register all EAP
  18. * methods that were linked in statically.
  19. */
  20. int eap_register_methods(void)
  21. {
  22. int ret = 0;
  23. #ifdef EAP_MD5
  24. if (ret == 0)
  25. ret = eap_peer_md5_register();
  26. #endif /* EAP_MD5 */
  27. #ifdef EAP_TLS
  28. if (ret == 0)
  29. ret = eap_peer_tls_register();
  30. #endif /* EAP_TLS */
  31. #ifdef EAP_UNAUTH_TLS
  32. if (ret == 0)
  33. ret = eap_peer_unauth_tls_register();
  34. #endif /* EAP_UNAUTH_TLS */
  35. #ifdef EAP_TLS
  36. #ifdef CONFIG_HS20
  37. if (ret == 0)
  38. ret = eap_peer_wfa_unauth_tls_register();
  39. #endif /* CONFIG_HS20 */
  40. #endif /* EAP_TLS */
  41. #ifdef EAP_MSCHAPv2
  42. if (ret == 0)
  43. ret = eap_peer_mschapv2_register();
  44. #endif /* EAP_MSCHAPv2 */
  45. #ifdef EAP_PEAP
  46. if (ret == 0)
  47. ret = eap_peer_peap_register();
  48. #endif /* EAP_PEAP */
  49. #ifdef EAP_TTLS
  50. if (ret == 0)
  51. ret = eap_peer_ttls_register();
  52. #endif /* EAP_TTLS */
  53. #ifdef EAP_GTC
  54. if (ret == 0)
  55. ret = eap_peer_gtc_register();
  56. #endif /* EAP_GTC */
  57. #ifdef EAP_OTP
  58. if (ret == 0)
  59. ret = eap_peer_otp_register();
  60. #endif /* EAP_OTP */
  61. #ifdef EAP_SIM
  62. if (ret == 0)
  63. ret = eap_peer_sim_register();
  64. #endif /* EAP_SIM */
  65. #ifdef EAP_LEAP
  66. if (ret == 0)
  67. ret = eap_peer_leap_register();
  68. #endif /* EAP_LEAP */
  69. #ifdef EAP_PSK
  70. if (ret == 0)
  71. ret = eap_peer_psk_register();
  72. #endif /* EAP_PSK */
  73. #ifdef EAP_AKA
  74. if (ret == 0)
  75. ret = eap_peer_aka_register();
  76. #endif /* EAP_AKA */
  77. #ifdef EAP_AKA_PRIME
  78. if (ret == 0)
  79. ret = eap_peer_aka_prime_register();
  80. #endif /* EAP_AKA_PRIME */
  81. #ifdef EAP_FAST
  82. if (ret == 0)
  83. ret = eap_peer_fast_register();
  84. #endif /* EAP_FAST */
  85. #ifdef EAP_PAX
  86. if (ret == 0)
  87. ret = eap_peer_pax_register();
  88. #endif /* EAP_PAX */
  89. #ifdef EAP_SAKE
  90. if (ret == 0)
  91. ret = eap_peer_sake_register();
  92. #endif /* EAP_SAKE */
  93. #ifdef EAP_GPSK
  94. if (ret == 0)
  95. ret = eap_peer_gpsk_register();
  96. #endif /* EAP_GPSK */
  97. #ifdef EAP_WSC
  98. if (ret == 0)
  99. ret = eap_peer_wsc_register();
  100. #endif /* EAP_WSC */
  101. #ifdef EAP_IKEV2
  102. if (ret == 0)
  103. ret = eap_peer_ikev2_register();
  104. #endif /* EAP_IKEV2 */
  105. #ifdef EAP_VENDOR_TEST
  106. if (ret == 0)
  107. ret = eap_peer_vendor_test_register();
  108. #endif /* EAP_VENDOR_TEST */
  109. #ifdef EAP_TNC
  110. if (ret == 0)
  111. ret = eap_peer_tnc_register();
  112. #endif /* EAP_TNC */
  113. #ifdef EAP_PWD
  114. if (ret == 0)
  115. ret = eap_peer_pwd_register();
  116. #endif /* EAP_PWD */
  117. #ifdef EAP_EKE
  118. if (ret == 0)
  119. ret = eap_peer_eke_register();
  120. #endif /* EAP_EKE */
  121. #ifdef EAP_SERVER_IDENTITY
  122. if (ret == 0)
  123. ret = eap_server_identity_register();
  124. #endif /* EAP_SERVER_IDENTITY */
  125. #ifdef EAP_SERVER_MD5
  126. if (ret == 0)
  127. ret = eap_server_md5_register();
  128. #endif /* EAP_SERVER_MD5 */
  129. #ifdef EAP_SERVER_TLS
  130. if (ret == 0)
  131. ret = eap_server_tls_register();
  132. #endif /* EAP_SERVER_TLS */
  133. #ifdef EAP_SERVER_UNAUTH_TLS
  134. if (ret == 0)
  135. ret = eap_server_unauth_tls_register();
  136. #endif /* EAP_SERVER_UNAUTH_TLS */
  137. #ifdef EAP_SERVER_MSCHAPV2
  138. if (ret == 0)
  139. ret = eap_server_mschapv2_register();
  140. #endif /* EAP_SERVER_MSCHAPV2 */
  141. #ifdef EAP_SERVER_PEAP
  142. if (ret == 0)
  143. ret = eap_server_peap_register();
  144. #endif /* EAP_SERVER_PEAP */
  145. #ifdef EAP_SERVER_TLV
  146. if (ret == 0)
  147. ret = eap_server_tlv_register();
  148. #endif /* EAP_SERVER_TLV */
  149. #ifdef EAP_SERVER_GTC
  150. if (ret == 0)
  151. ret = eap_server_gtc_register();
  152. #endif /* EAP_SERVER_GTC */
  153. #ifdef EAP_SERVER_TTLS
  154. if (ret == 0)
  155. ret = eap_server_ttls_register();
  156. #endif /* EAP_SERVER_TTLS */
  157. #ifdef EAP_SERVER_SIM
  158. if (ret == 0)
  159. ret = eap_server_sim_register();
  160. #endif /* EAP_SERVER_SIM */
  161. #ifdef EAP_SERVER_AKA
  162. if (ret == 0)
  163. ret = eap_server_aka_register();
  164. #endif /* EAP_SERVER_AKA */
  165. #ifdef EAP_SERVER_AKA_PRIME
  166. if (ret == 0)
  167. ret = eap_server_aka_prime_register();
  168. #endif /* EAP_SERVER_AKA_PRIME */
  169. #ifdef EAP_SERVER_PAX
  170. if (ret == 0)
  171. ret = eap_server_pax_register();
  172. #endif /* EAP_SERVER_PAX */
  173. #ifdef EAP_SERVER_PSK
  174. if (ret == 0)
  175. ret = eap_server_psk_register();
  176. #endif /* EAP_SERVER_PSK */
  177. #ifdef EAP_SERVER_SAKE
  178. if (ret == 0)
  179. ret = eap_server_sake_register();
  180. #endif /* EAP_SERVER_SAKE */
  181. #ifdef EAP_SERVER_GPSK
  182. if (ret == 0)
  183. ret = eap_server_gpsk_register();
  184. #endif /* EAP_SERVER_GPSK */
  185. #ifdef EAP_SERVER_VENDOR_TEST
  186. if (ret == 0)
  187. ret = eap_server_vendor_test_register();
  188. #endif /* EAP_SERVER_VENDOR_TEST */
  189. #ifdef EAP_SERVER_FAST
  190. if (ret == 0)
  191. ret = eap_server_fast_register();
  192. #endif /* EAP_SERVER_FAST */
  193. #ifdef EAP_SERVER_WSC
  194. if (ret == 0)
  195. ret = eap_server_wsc_register();
  196. #endif /* EAP_SERVER_WSC */
  197. #ifdef EAP_SERVER_IKEV2
  198. if (ret == 0)
  199. ret = eap_server_ikev2_register();
  200. #endif /* EAP_SERVER_IKEV2 */
  201. #ifdef EAP_SERVER_TNC
  202. if (ret == 0)
  203. ret = eap_server_tnc_register();
  204. #endif /* EAP_SERVER_TNC */
  205. #ifdef EAP_SERVER_PWD
  206. if (ret == 0)
  207. ret = eap_server_pwd_register();
  208. #endif /* EAP_SERVER_PWD */
  209. return ret;
  210. }